Guest User

Untitled

a guest
Nov 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $.address.state('/');
  4.  
  5. $.address.change(function(event) {
  6.  
  7. if($.isEmptyObject(event.parameters))
  8. return;
  9.  
  10. $('#search').val(event.parameters.q);
  11.  
  12. $('#loading').slideToggle('fast', function() {
  13. $.ajax({
  14. url: event.path,
  15. data: event.parameters,
  16. success: function(html) {
  17. $('#loading').slideToggle('fast');
  18. $('#content').html(html);
  19. }
  20. })
  21. });
  22.  
  23. });
  24.  
  25. $('form').live('submit', function() {
  26. var action = $(this).attr('action'),
  27. params = $(this).serialize();
  28.  
  29. $.address.value(action + '?' + params);
  30.  
  31. return false;
  32. })
  33.  
  34. $('.pagination a').live('click', function() {
  35. var href = $(this).attr('href');
  36.  
  37. $.address.value(href);
  38. return false;
  39. })
  40.  
  41. </script>
Add Comment
Please, Sign In to add comment