exiting javascript?

They have: 1,587 posts

Joined: Mar 1999

um, when using cgi exit will end the script/loop. what's a similiar command in javascript?

i tried using break, is there a trick to using it?

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

this works for me... IE5 win98

<html>
<body>
<input name=stuff type=text>
&lt;script language=javascript&gt;
<!--
for (i=0;i<10;i++) {
  if (i==5) {
    break;
  }
  else {
    stuff.value += i;
  }
}
//-->
&lt;/script&gt;
</body>
</html>
'

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 1,587 posts

Joined: Mar 1999

k, thx i'll give it a try. Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.