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):