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 Link to comment https://forums.phpfreaks.com/topic/42936-breaking-javascript/ 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 Link to comment https://forums.phpfreaks.com/topic/42936-breaking-javascript/#findComment-208638 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? Link to comment https://forums.phpfreaks.com/topic/42936-breaking-javascript/#findComment-208883 Share on other sites More sharing options...
fenway Posted March 16, 2007 Share Posted March 16, 2007 You mean like return, break and continue? Link to comment https://forums.phpfreaks.com/topic/42936-breaking-javascript/#findComment-209013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.