Guest User

Untitled

a guest
Jul 17th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <div id="olderpost"><a onclick="$.ajax({ dataType: 'script', url: '/actions/olderpost/20'}); return false;" href="/actions/olderpost/20">View older actions</a></div>
  2.  
  3. $('#olderpost').html().replace('20', '30');
  4.  
  5. $('#olderpost').html($('#olderpost').html().replace(/20/g, '30'));
  6.  
  7. <div id="olderpost">
  8. <a href="/actions/olderpost/20">View older actions</a>
  9. </div>
  10.  
  11. $('#olderpost a').click(function(e) {
  12. e.preventDefault();
  13. $.ajax({dataType: 'script', url: $(this).attr('href')});
  14. });
  15.  
  16. $('#olderpost a').attr('href', function(i, v) {
  17. return v.replace('20', '30');
  18. });
Add Comment
Please, Sign In to add comment