1 <HTML> 2 <HEAD> 3 <TITLE>JavaScript Example: do-while-loop</TITLE> 4 </HEAD> 5 6 <BODY BGCOLOR="#FFFFFF"> 7 8 <SCRIPT LANGUAGE="JavaScript"> 9 <!-- hide script from old browsers 10 11 var URL; 12 do { 13 URL = window.prompt( "Type in a URL:", "" ); 14 } while ( URL == "" ); 15 16 if ( URL != null ) window.location = URL; 17 document.write( "<H1>Reload this page and try again!</H1>" ); 18 19 // end script hiding --> 20 </SCRIPT> 21 22 </BODY> 23 </HTML>