Change browser address bar URL with jQuery without reloading For example,
www.mywebsite/list.php?page=1
<a href="?page=<?php $row[id] ?>" > this link </a>
on click change address bar ?id=123 etc...
-
Change browser address bar URL with jQuery without reloading For example, www.mywebsite/list.php?page=1 <a href"?page=<?php row[id] ?>" > this link </a> on click change adress bar ?id=123 etc...Shauzab Ali– Shauzab Ali2012年08月29日 07:15:26 +00:00Commented Aug 29, 2012 at 7:15
-
Changing the address bar url, client side will always reload, unless you add and anchor, as in ddfd.com#thisisananchertoaspecificplaceinthedocument.ShaunOReilly– ShaunOReilly2012年08月29日 07:25:39 +00:00Commented Aug 29, 2012 at 7:25
-
do you mind the appropriate answer to be marked as **accepted **GajendraSinghParihar– GajendraSinghParihar2012年09月26日 12:49:35 +00:00Commented Sep 26, 2012 at 12:49
-
Possible in HTML5 browsers only. aspsnippets.com/Articles/…Govind Totla– Govind Totla2015年10月07日 11:44:23 +00:00Commented Oct 7, 2015 at 11:44
3 Answers 3
not possible at all to change the url or even query string of the browser without reloading only part you can change without refresh is #hash part of the url till html4
But in html 5 some kind of url change can be done by the new HISTORY API give it a try
Comments
You can not. If you try to do it like this for example:
document.location.search= "?i=123"
It will reload the page. What you can do is change the hash
document.location.hash= "#123"
or
document.location.hash= "#i=123
And then write a simple parsor using split to grab the data you need. Similar question you should have a look at.
1 Comment
jQuery: pjax plugin may help you.