Guest User

Untitled

a guest
Jul 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. var hashIO = {
  2. url : '/content',
  3. on : {
  4. success : function (){},
  5. error : function(){}
  6. }
  7. };
  8.  
  9. YUI().use('node','event-mouseenter','io',function(Y){
  10.  
  11. var curHash = '';
  12. var hash = '';
  13.  
  14. function hashUpdate(){
  15. hash = location.hash.substring(1);
  16. if(curHash != hash)
  17. {
  18. curHash = hash;
  19. loadNewHash();
  20. }
  21. }
  22.  
  23. function loadComplete(id, o, args){
  24. try{
  25. var page = o.responseText;
  26. }catch(e){
  27. Y.log(e);
  28. }
  29.  
  30. }
  31.  
  32. function loadNewHash()
  33. {
  34. var uri = hashIO.url + hash + '.php';
  35.  
  36. hashIO.on.success = Y.bind(loadComplete, this);
  37. request = Y.io(uri, hashIO);
  38. }
  39.  
  40. setInterval(hashUpdate,20);
  41. });
Add Comment
Please, Sign In to add comment