October 22, 2009

Dynamic url changing using javascript

We all have instances where we want to change the url without reloading the page. its easy and simple to do. just append '#' to the url
ie:
 window.location.hash = "test";
it will add http://whiteboard1900.blogspot.com/#test
at the end of the url.
or alternatively use:
window.location.href=window.location.href+"#testval=1";

No comments:

Post a Comment