Home   News  Product reviews  Website reviews  Forums   Competitions  Subscribe 


Web Building >> Web design & build

 |  Print Thread
palomares
regular


Reg'd: Thu
Posts: 36
Is there the equivalent of Goto in Javascript?
      Fri Mar 18 2005 08:55 PM

Hi,

I am a complete beginner ,trying to learn some Javascript. I was asking myself if there is a command , like the Goto command in Basic. I remember:

10 bla bla
20 bla bla
30 if (Something) goto 10

Or if this is more helpful:



var number ;

number = prompt("Please enter a number"," ");

number = parseInt(number)

if (isNaN(number))
{
document.write("This is not a number<br />");
document.write(" Please try again!");

}
else

{
var result ;

result = 2*number ;

document.write("The number times two is = "+result);
}


Just after the

"Please try again",..., I'd like to make it return to the first line, therefore asking the user to add another input,...

Could anybody point me in the right direction of a command which would do this?
Many Thanks


Post Extras Print Post   Remind Me!     Notify Moderator
Rate this thread

Jump to


Entire topic
Subject Posted by Posted on
* Is there the equivalent of Goto in Javascript? palomares Fri Mar 18 2005 08:55 PM
. * * Re: Is there the equivalent of Goto in Javascript? paul_lomax   Sat Mar 19 2005 03:24 AM

Extra information
0 registered and 4 anonymous users are browsing this forum.

Moderator:  putasolutions, Joe_London, greysts, bricat, Nanook, Hello_There, John_McKenna, Mouse, TheFatControlleR 


Print Thread
Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      Mark-up is enabled

Rating:
Thread views: 292

Contact Us | Privacy statement Main website