Pavlos1316 Posted November 18, 2014 Share Posted November 18, 2014 (edited) 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'); }); }); Edited November 18, 2014 by Pavlos1316 Quote Link to comment https://forums.phpfreaks.com/topic/292557-change-url-using-windowhistorypushstate/ Share on other sites More sharing options...
Solution Pavlos1316 Posted November 18, 2014 Author Solution Share Posted November 18, 2014 I just had not to use the '' when using the variable. window.history.pushState('','',page); Quote Link to comment https://forums.phpfreaks.com/topic/292557-change-url-using-windowhistorypushstate/#findComment-1496961 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.