External Link Speedbump


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1.  
  2. // Begin external link speedbump - loop though each link
  3. jQuery('a').each(function(){
  4. var href = jQuery(this).attr('href');
  5. //check for links starting with http or https, making sure that links to My Nymeo and to our own domain are excluded
  6. if ((href.match(/^https?\:/i)) && (!href.match(document.domain)) && (!href.match(/pcu.comstarfcu.org/i))){
  7. jQuery(this).click(function() {
  8. // On click display confirmation box
  9. var sb=confirm('You are about to leave the Nymeo web site. Please click OK to continue or Cancel to remain on this page.');
  10. // If OK is clicked follow the link
  11. if (sb==true) { window.location(href); }
  12. else { return false; }
  13. });
  14. }
  15. });
  16. // End external link speedbump

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.