Jump to content

Change url using window.history.pushState


Pavlos1316

Recommended Posts

Is there a way to change the url in the code below using window.history.pushState dynamically to match the "page" variable?



$(document).ready(function(){

$('#all').delegate('a.pop-lnk', 'click', function(){
var page = $(this).attr('id');
$('#popup').load("../folder/"+ page + ".php");

window.history.pushState('','','/page');
});
});

Link to comment
https://forums.phpfreaks.com/topic/292557-change-url-using-windowhistorypushstate/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.