|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
JavaScript Label problem :(
Hello all, i have been wrote small and very simple code,but it's not work
![]() Code:
i==1;
count_loop:
alert("Hi");
if(i==1)
{
i++;
continue count_loop;
}
I have error - Label not found...what the problem ? Please help me to fix it. PS: Sorry for my english ![]() |
|
#2
|
|||
|
|||
|
JavaScript Label problem
I don't think the continue statement works outside of a loop,
but you can try the break statement, and add the braces to surround the code block: <script language="javascript"> count_loop: { var i=1; alert("Hi"); if (i==1) { i++; break count_loop; } } </script> |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > JavaScript Label problem :( |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|