PHP/jQuery - Dynamically change page URL without refreshing -
i have search facility, example url like:-
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
Post a Comment