Web Hosting Offers
See the new scripts recently added to Dynamic Drive. Click here.
Original, practical CSS codes and examples such as CSS menus for your site.
javascript tutorial Browse Basic JavaScript Tutorial
Browse JavaScript Script resources
Browse javascript FAQS
Categories:

javascript tutorial
buy template
Home >> Tutorials >> Advanced javascript tutorials

URL example

Enter a url in the textbox and then click go. It even updates the status bar with the new url and a message

http://

<html>
<head>

<script language="javascript">
<!--

function Go(j) {
window.status=('Connecting....')

var newURL;
newURL = document.testform.goto.value

if (URLis == "" || URLis.length <= 7)
  {
j.value = "Try Again"
alert('\nOops!\n\nYou must enter a valid URL');
window.status=('Missing data or Invalid. Try again?.')
   }
else
   {
j.value = "Connecting to: http:\\" + URLis
var location=("http://" + URLis);
this.location.href = location
window.status=('Connecting to ' + URLis + ' Please wait........');
   }
}
--!>
</script>
</head>

<body>

<FORM NAME="testform">
http://
<input maxlength=50 name=goto size=55><br>
<input onClick=Go(this) type=button value=" Go to.. " width="50" name="button">
<form>

</body></html>

 


Page contents: itechies.net - Enter a url in the textbox and then click go
javascript tutorial
javascript book
Buy this book