11

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...

4
  • 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... Commented 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. Commented Aug 29, 2012 at 7:25
  • do you mind the appropriate answer to be marked as **accepted ** Commented Sep 26, 2012 at 12:49
  • Possible in HTML5 browsers only. aspsnippets.com/Articles/… Commented Oct 7, 2015 at 11:44

3 Answers 3

5

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

http://html5demos.com/history

2

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
  • Note that # (hash) params cannot be read on server side like ? (query) params - initial usage of # in urls is for "go-to anchor/id" functionality Commented Aug 29, 2012 at 7:21
2

jQuery: pjax plugin may help you.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.