So I’m in the proccess of creating an AJAX based WP theme. This is the state I’ve reached so far:
- Capture all menu link clicks with .on(‘click’)
- Change status bar with history.pushState() method (**#**hashtag method is not an option)
- Get the preferred content with $.get() method and place it in the page section
What I tried:
- Tried to use different load methods .load(url+’ #content’), etc., finally I figured out the scripts should be executed again after I load them into the page (or not? ) so…
- I collected all scripts from the requested page’s head and run them with $.getScript() method. Result: page became slow and in some cases it seemed like it fell into a loop
Please let me know if I approach the whole thing wrong or you have a better idea! Thank you in advance!