PHP/jQuery - Dynamically change page URL without refreshing -


i have search facility, example url like:-

http://www.website.com/properties/?house_town=&min_price=0&house_type=&max_price=9999999&house_status=buy&order=desc

what want create link, i.e.

<a id="test" href="#">order asc</a>

that update records on page on click of above link, therefore need update url &order=asc re-order listing on page.

at moment doing follows:-

jquery('#test').on('click', function(e) {     e.originalevent.currenttarget.href = window.location.href +'?order=desc'; }); 

this gets current url , adds value after url. problem keeps addings ?order=desc?order=desc every time click. problem if ?order=desc in url.

any appreciated!


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -