There are few solutions:
- Use location.replace('http://www.theURL.com')
The replace method loads the specified URL over the current history entry, it meant after the replace method is used, the user cannot navigate to the previous URL by using browser's Back button. - Use window.location='http://www.theURL.com'; return false;
It will allow you to navigate to the previous URL by using browser's Back button.
E.g.:
<tr>
<td onclick="window.location='http://www.theURL.com'; return false;" style="cursor: pointer;">
</td>
</tr> - Use location.href='http://www.theURL.com';
Another solution provided by reader (updated 10/08/2009):
4 則留言:
very useful
Hi I'm try this
location.href = 'url.com';
not this
location.href("url.com");
can work with Safari
hi 玩耍, thanks for the new solution.
Hello! I just wish to give a huge thumbs up for the nice info you might have here on this post.
I shall be coming back to your weblog for more soon.
Here is my web site: caster semenya wikipedia free encyclopedia
發佈留言