Comments on: Test for an external link https://j11y.io/snippets/test-for-an-external-link/ Sun, 22 Mar 2015 15:39:22 +0000 hourly 1 https://wordpress.org/?v=5.0.13 By: Carsten https://j11y.io/snippets/test-for-an-external-link/#comment-348 Thu, 01 Jan 2009 13:43:48 +0000 https://j11y.io/?p=312#comment-348 Hi James,
I love your snippets – this one is another beauty! Personally I don’t like using large frameworks because of the overhaed and all the stuff you need to learn but are not really interested in …

So, keep on bringing on the snippets! 😉

]]>
By: James https://j11y.io/snippets/test-for-an-external-link/#comment-347 Wed, 31 Dec 2008 11:39:31 +0000 https://j11y.io/?p=312#comment-347 Pete, Regex may be a little more concise but it won’t work if you use absolute URLs for internal links…

]]>
By: Pete https://j11y.io/snippets/test-for-an-external-link/#comment-346 Wed, 31 Dec 2008 11:12:50 +0000 https://j11y.io/?p=312#comment-346 I guess it’s personal preference, but I like the terseness of Regular Expressions:

return /^http:///i.test(href);
]]>