I write some JS code programmaticall y in code behind (.Net) and I need to stop the code to being executed at a certain point.
In my HTML I have something like that:
In other words I need not to continue to fillMyTable() etc etc if GetBacktoServer () return true.
I know this could be simply done with:
but as I'm generating the code programmaticall y this is quite hard to do for various reasons, so I need to use a return if true.
The above works fine in Chrome but doesn't work in FireFox and IE. (firebug says return not in function)
Any suggestions?
In my HTML I have something like that:
Code:
<script type="text/javascript"> initMyStuff(); if(GetBacktoServer()) return; fillMyTable(); etc etc etc
I know this could be simply done with:
Code:
if(!GetBacktoServer()) {
fillMyTable();
etc etc etc
}
The above works fine in Chrome but doesn't work in FireFox and IE. (firebug says return not in function)
Any suggestions?
Comment