This is simple but I have not found a solution in the last 8 hours of search.
What I need is to implement the history push state from jQuery but I have no idea how to.
I have tried to understand how to use history.js and other codes but they seem way to complicated.
Is there a simple solution for this or am I just still too amateur?
Features I need: Url change without the content. Back and foward button without losing the ajax call.
I have the following codes:
As JS I have:
<script> $(document).ready(function(){ $("#module").load("module.php?module=home"); $("#home_button").click(function(){ $("#module").load("module.php?module=home"); }); $("#account_button").click(function(){ $("#module").load("module.php?module=account"); }); $("#raul_button").click(function(){ $("#module").load("module.php?module=profile&user_url=raul"); }); }); </script> As HTML I have:
<button id="home_button">HOME</button> <button id="raul_button">RAUL PROFILE</button> <button id="account_button">ACCOUNT</button> <div id="module"></div> HTACCESS
RewriteRule members(.*)\.aspx$ /?module=profile RewriteRule ^([^/]*)\.aspx$ /?module=$1 [L] RewriteRule ^([^/]*)\.html$ /index.php?module=profile&user_url=$1 [L]
window.history.pushState(null, null, '/home-link);