views:

203

answers:

3

Hi I want to change the url or query string without reloading the page...

I have used the QUERY STRING OBJECT plugin for jquery

I have this example page in which on click of a album it should change the query string...

Now i can change the url using the code

window.location.href =  $.query.set('aid', a_id);

but it goes for reloading the page...

and this code does not have any effect

 var newUrl =  $.query.set('aid', a_id);

How can do without reloading the page...

how can i do without reloading the page...

Thanks
Pradyut
India

A: 

You cannot change the query string without reloading the page.

MasterGaurav
+2  A: 

I got the solution...

change the query string after a #

you can get and set the query string using javascript

location.hash = 'something=anything'

Thanks
Pradyut
India

Pradyut Bhattacharya
+1  A: 

Another solution which you may find useful is the BBQ plugin for jQuery. Here's an example: http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/

Cuga
thank you sir for replying... btw i hate non-veg :-)
Pradyut Bhattacharya