External links in jquery

I'm using the jquery-confirm library to add a popup confirmation for all external links. I'm currently using if(this.href.indexOf(window.location.host) == -1 ) { to check for external links, but this is returning TEL links as well. Is there any way to tell my IF statement to ignore phone numbers? Or maybe to ignore links with a specific class, and then I can add a class to ones where I don't need the confirmation?


Read more here: https://stackoverflow.com/questions/67374417/external-links-in-jquery

Content Attribution

This content was originally published by 801red at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: