Pavlos1316 Posted November 18, 2014 Share Posted November 18, 2014 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 More sharing options...
Pavlos1316 Posted November 18, 2014 Author Share Posted November 18, 2014 I just had not to use the '' when using the variable. window.history.pushState('','',page); Link to comment https://forums.phpfreaks.com/topic/292557-change-url-using-windowhistorypushstate/#findComment-1496961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.