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.