|
| ||||||||||
| Tags: exit function, exit procedure, javascript, validate forms |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How do we write exit procedure or function in javascript to exit middle of the program?
|
|
#2
| ||||
| ||||
| Re: How do we write exit procedure or function in javascript to exit middle of the program?
"return" lets you exit a function and optionally return a value. Since you have multiple RadioButtons with the same name, document.RequestForm.DBEnhance will return an array. There is no such global function either. In fact, even if you use return, which can be used to prematurely exit functions. And also there is no need to call anything to exit an if statement, it does so automatically once the script within the statement is executed. |
|
#3
| ||||
| ||||
| Re: How do we write exit procedure or function in javascript to exit middle of the program?
I'm not sure if I agree with you here. I was always under the impression that the break statement can be used to break out of a while, if, switch, or for statement. I hate to suggest this but how about thinking of causing an error to occur in the JavaScript code? That stops execution so that you don't have to loop endlessly and have a potential crash on your hands. |
|
#4
| |||
| |||
| Re: How do we write exit procedure or function in javascript to exit middle of the program?
If the function supplied is the only script then it will automatically cease with the execution with the edit that I supplied, if it is called by another function then all that has to be done is to return false to that call. The code throws up "'exit' is undefined" most likely because 'exit' is undefined in that Javascript. It's not on the list of reserved words for the language, and you haven't defined it anywhere. While the break statement on its own can only be used to exit a loop, the optional label can be added to break to exit any kind of statement. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How do we write exit procedure or function in javascript to exit middle of the program?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| StarCraft 2 crashes on exit | Reuben 1 | Video Games | 6 | 25-03-2011 10:20 PM |
| how to exit from align screen | Koena | Portable Devices | 4 | 10-11-2010 06:45 AM |
| Exit a Silverlight Application | KornFlexia | Portable Devices | 4 | 26-10-2010 07:43 PM |
| When I exit from Gomorrah it Crashes | Hishem-Remashiya | Video Games | 5 | 25-10-2010 09:16 AM |
| Visual C++ to end a loop & exit from program? | RadhaV | Software Development | 4 | 21-02-2009 05:58 PM |