guyfromfl Posted March 16, 2007 Share Posted March 16, 2007 Is there anyway to make java break if a condition tests false? im trying to do a simple browser check and if it tests as IE it will use a different page than netscape... but right now i just want it to break with document.write("Not compatible with IE") and stop before loading the rest of the code. (since i have to refine alot of my code to conform to the gates regime) thanks Quote Link to comment Share on other sites More sharing options...
anatak Posted March 16, 2007 Share Posted March 16, 2007 I am not sure if I understand what you want to do but I think you have to look into exceptions http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Exception_Handling_Statements:try...catch_Statement anatak Quote Link to comment Share on other sites More sharing options...
guyfromfl Posted March 16, 2007 Author Share Posted March 16, 2007 basically is there a command like php's exit; to stop the code? Quote Link to comment Share on other sites More sharing options...
fenway Posted March 16, 2007 Share Posted March 16, 2007 You mean like return, break and continue? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.