Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 Javascript Articles

Using Javascript we are able to change the URL referenced in our browser. This may be used for creating onclick actions for iamges, form buttons, or perhaps as a redirect on a page which is no longer in use.

Using Javascript the location for the current browser is set using

window.location.href = url('newpagelocation.html')

As an example, within the head of the html page add

<SCRIPT language="JavaScript">
function redirect() {
window.location = 'http://www.newpagelocation.com'
}
</SCRIPT>

and in the body of the page add

<FORM ID="Form1">
  <INPUT onclick="redirect()" type="button" value="Next" ID="Button1" NAME="Button1">
</FORM>

If the aim is to reload the current page, then there is a simpler specific method.

window.location.reload()

NAT September 2005 (Revised)


This article viewed: 4771 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Tuesday, May 13, 2008