Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. // better to do this ...
  2.  
  3. $('a').live('click', function(e) {
  4. var $this = $(this);
  5. if ($this.attr('href').match(/^https:/)) {
  6. e.preventDefault();
  7. alert('you clicked on a secure link!');
  8. }
  9. });
  10.  
  11.  
  12. // or this ...
  13.  
  14. $('a[href^=https:]').click(function(e) {
  15. e.preventDefault();
  16. alert('you clicked on a secure link!');
  17. });
  18.  
  19. // or this ...
  20.  
  21. $('a[href^=https:]').live('click', function(e) {
  22. e.preventDefault();
  23. alert('you clicked on a secure link!');
  24. });
Add Comment
Please, Sign In to add comment