23 March 2011

How to redirect or link to other page using javascript ?

 Sometimes you need use link as part of your javascript (for example when you using onclick event) and what  you need to do is this line:

window.location = "http://pastor.ovh.org/"
for example:

<input type="button" value="Go to my rubbish hopepage" onclick="window.location = 'reloadMessage.html'"></input>

No comments:

Post a Comment