Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // better to do this ...
- $('a').live('click', function(e) {
- var $this = $(this);
- if ($this.attr('href').match(/^https:/)) {
- e.preventDefault();
- alert('you clicked on a secure link!');
- }
- });
- // or this ...
- $('a[href^=https:]').click(function(e) {
- e.preventDefault();
- alert('you clicked on a secure link!');
- });
- // or this ...
- $('a[href^=https:]').live('click', function(e) {
- e.preventDefault();
- alert('you clicked on a secure link!');
- });
Add Comment
Please, Sign In to add comment