Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. const routes = {};
  2.  
  3. window.onpopstate = function(event) {
  4. console.log('window.onpopstate');
  5. $("html").html(routes[window.location.pathname]);
  6. };
  7.  
  8. window.addEventListener('load', function() {
  9. console.log('window.load');
  10. $("html").html(routes[window.location.pathname]);
  11. });
  12.  
  13. history.pushState({}, window.location.pathname, window.location.origin + uri);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement