Test if links are external with jQuery / javascript?
Posted
by Matrym
on Stack Overflow
See other posts from Stack Overflow
or by Matrym
Published on 2010-05-26T07:37:25Z
Indexed on
2010/05/26
7:41 UTC
Read the original article
Hit count: 179
How do I test to see if links are external or internal? Please note:
- I cannot hard code the local domain.
- I cannot test for "http". I could just as easily be linking to my own site with an http absolute link.
- I want to use jQuery / javascript, not css.
I suspect the answer lies somewhere in location.href, but the solution evades me.
Thanks!
© Stack Overflow or respective owner