Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('document').ready(function () {
- $('#contentHolder').on('click', '.historyAPI', function (e) {
- e.preventDefault();
- var href = $(this).attr('href');
- getContent(href, true);
- });
- });
- window.addEventListener("popstate", function (e) {
- getContent(location.pathname, false);
- });
- function getContent(url, addEntry) {
- $(function () {
- $("#contentHolder").load(url);
- });
- if (addEntry == true) {
- history.pushState(null, null, url);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement