Reputation: 11374
I've tried to use the HTML5 window.history.pushState function, but i can't quite get it working.
This is the function:
function changeUrl() {
window.history.pushState(object, "Title", "?side=annoncer&sletid=1");
}
And this is the link which should invoke it:
<a href="javascript:void(0);" onClick="changeUrl();">
What did i do wrong?
Upvotes: 0
Views: 823
Reputation: 4643
Change it to:
window.history.pushState(null, "Title", "?side=annoncer&sletid=1");
Upvotes: 0
Reputation: 624
you don't need to set an object
function changeUrl() {
window.history.pushState(null, "Title", "?side=annoncer&sletid=1");
}
check it and it'll work fine.
Upvotes: 5