<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Quick Tip: Dynamically add an icon for external links</title>
	<atom:link href="http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:50:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Top jQuery tips &#38; tricks for jQuery programmers – Part IV : Marketing</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-84392</link>
		<dc:creator>Top jQuery tips &#38; tricks for jQuery programmers – Part IV : Marketing</dc:creator>
		<pubDate>Fri, 09 Sep 2011 16:53:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-84392</guid>
		<description>[...] This trick is pretty simple and good for usability. If links are linking to external website, an image will be displayed next to the link. Dynamically add an icon for external links [...]</description>
		<content:encoded><![CDATA[<p>[...] This trick is pretty simple and good for usability. If links are linking to external website, an image will be displayed next to the link. Dynamically add an icon for external links [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bart&#039;s notes &#187; Blog Archive &#187; Easily track outgoing links with jQuery and Google Analytics</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-83717</link>
		<dc:creator>Bart&#039;s notes &#187; Blog Archive &#187; Easily track outgoing links with jQuery and Google Analytics</dc:creator>
		<pubDate>Thu, 19 May 2011 09:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-83717</guid>
		<description>[...] problem, you can do like me and borrow this trick from Karl Swedberg: $&#040;&#039;a&#039;&#041;.filter&#040;function&#040;&#041; &#123; return this.hostname &amp;&amp; this.hostname [...]</description>
		<content:encoded><![CDATA[<p>[...] problem, you can do like me and borrow this trick from Karl Swedberg: $&#040;&#039;a&#039;&#041;.filter&#040;function&#040;&#041; &#123; return this.hostname &amp;&amp; this.hostname [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emmanuel K</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-83302</link>
		<dc:creator>Emmanuel K</dc:creator>
		<pubDate>Wed, 08 Dec 2010 15:42:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-83302</guid>
		<description>Works as expected, thanks a lot!!</description>
		<content:encoded><![CDATA[<p>Works as expected, thanks a lot!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-83297</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Wed, 08 Dec 2010 13:49:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-83297</guid>
		<description>Hi there, 
You could write a little function that strips the subdomain before comparing. The function could look something like this:

&lt;pre&gt;&lt;code&gt;function stripSub(str) {
  var parts = str.split(&#039;.&#039;);
  if (parts.length === 3) {
    parts.shift();
  }
  return parts.join(&#039;.&#039;);
}
&lt;/code&gt;&lt;/pre&gt;

Then your return statement would look like this:
&lt;pre&gt;&lt;code&gt;return this.hostname &amp;&amp;
   stripSub(this.hostname) !== stripSub(location.hostname);
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi there,<br />
You could write a little function that strips the subdomain before comparing. The function could look something like this:</p>
<pre><code>function stripSub(str) {
  var parts = str.split('.');
  if (parts.length === 3) {
    parts.shift();
  }
  return parts.join('.');
}
</code></pre>
<p>Then your return statement would look like this:</p>
<pre><code>return this.hostname &#038;&#038;
   stripSub(this.hostname) !== stripSub(location.hostname);
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emmanuel K</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-83294</link>
		<dc:creator>Emmanuel K</dc:creator>
		<pubDate>Wed, 08 Dec 2010 12:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-83294</guid>
		<description>Hi Karl, another great post from you! keep up with the good work.. I have a question regarding this post, lets say I have a subdomain of help.whatever.com and I don&#039;t want the external link icon to appear on links of my main domain which could be www.whatever.com I want them both to be consider as one domain.. How can I do that? Any recommendation? 

Cheers,
 E.K</description>
		<content:encoded><![CDATA[<p>Hi Karl, another great post from you! keep up with the good work.. I have a question regarding this post, lets say I have a subdomain of help.whatever.com and I don&#8217;t want the external link icon to appear on links of my main domain which could be <a href="http://www.whatever.com" rel="nofollow">http://www.whatever.com</a> I want them both to be consider as one domain.. How can I do that? Any recommendation? </p>
<p>Cheers,<br />
 E.K</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Lockie</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-79747</link>
		<dc:creator>David Lockie</dc:creator>
		<pubDate>Fri, 26 Feb 2010 16:21:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-79747</guid>
		<description>@Karl - thanks for the non-image-containing-link selector. Tried every syntax EXCEPT that one ;)</description>
		<content:encoded><![CDATA[<p>@Karl &#8211; thanks for the non-image-containing-link selector. Tried every syntax EXCEPT that one ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-79709</link>
		<dc:creator>david</dc:creator>
		<pubDate>Mon, 15 Feb 2010 16:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-79709</guid>
		<description>Late reply, I know, but you could include

&lt;code&gt;white-space: nowrap;&lt;/code&gt;

with your a.external style, with the caveat that long links could break your design somewhere.</description>
		<content:encoded><![CDATA[<p>Late reply, I know, but you could include</p>
<p><code>white-space: nowrap;</code></p>
<p>with your a.external style, with the caveat that long links could break your design somewhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-79594</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Wed, 20 Jan 2010 18:38:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-79594</guid>
		<description>My recommendation is to take the advice from the people on that forum: ignore those Firefox warnings. They&#039;re meaningless within the context of JavaScript.</description>
		<content:encoded><![CDATA[<p>My recommendation is to take the advice from the people on that forum: ignore those Firefox warnings. They&#8217;re meaningless within the context of JavaScript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Frederic</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-79593</link>
		<dc:creator>Jean-Frederic</dc:creator>
		<pubDate>Wed, 20 Jan 2010 18:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-79593</guid>
		<description>this is the error message i got.

Warning: Unknown pseudo-class or pseudo-element &#039;has&#039;.  Malformed simple selector as negation pseudo-class argument &#039;has&#039;.

On some forum, peoples are saying this : 
it&#039;s not an error, it&#039;s just a warning.
And this particular warning tells us that Firefox is not aware of
jQuery selectors, at least not of the :gt() selector, but, as long as
you know that it is a valid selector (and it works), you should just
ignore the warning.... 

Is there something we can do for this ? or just wait for the jQuery 1.5 to solve that issue ? or maybe next version of FireFox...

Thanks</description>
		<content:encoded><![CDATA[<p>this is the error message i got.</p>
<p>Warning: Unknown pseudo-class or pseudo-element &#8216;has&#8217;.  Malformed simple selector as negation pseudo-class argument &#8216;has&#8217;.</p>
<p>On some forum, peoples are saying this :<br />
it&#8217;s not an error, it&#8217;s just a warning.<br />
And this particular warning tells us that Firefox is not aware of<br />
jQuery selectors, at least not of the :gt() selector, but, as long as<br />
you know that it is a valid selector (and it works), you should just<br />
ignore the warning&#8230;. </p>
<p>Is there something we can do for this ? or just wait for the jQuery 1.5 to solve that issue ? or maybe next version of FireFox&#8230;</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Frederic</title>
		<link>http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links/comment-page-1#comment-79591</link>
		<dc:creator>Jean-Frederic</dc:creator>
		<pubDate>Wed, 20 Jan 2010 15:57:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#comment-79591</guid>
		<description>&lt;code&gt;$(document).ready(function() {  $(&#039;a:not(.nojqueryanchor):not(:has(img))&#039;).filter(function() { return this.hostname &amp;&amp; this.hostname !== location.hostname;  }).after(&#039; &#039;).attr(&#039;target&#039;, &#039;_blank&#039;);});&lt;/code&gt;

This is my latest code. Unfortunatly, im getting an error about &quot;has&quot; that is malformed, in the Firefox&#039;s console.

Do i need to add something ? like.... &lt;code&gt;:not(&quot;:has(img)&quot;)&lt;/code&gt;... or  &lt;code&gt;:not(&quot;:has(&quot;img&quot;)&quot;)&lt;/code&gt;

Thanks</description>
		<content:encoded><![CDATA[<p><code>$(document).ready(function() {  $('a:not(.nojqueryanchor):not(:has(img))').filter(function() { return this.hostname &amp;&amp; this.hostname !== location.hostname;  }).after(' ').attr('target', '_blank');});</code></p>
<p>This is my latest code. Unfortunatly, im getting an error about &#8220;has&#8221; that is malformed, in the Firefox&#8217;s console.</p>
<p>Do i need to add something ? like&#8230;. <code>:not(":has(img)")</code>&#8230; or  <code>:not(":has("img")")</code></p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 10/25 queries in 0.008 seconds using disk: basic
Object Caching 377/392 objects using disk: basic
Content Delivery Network via learningjquery.kswedberg.netdna-cdn.com

Served from: www.learningjquery.com @ 2012-02-08 17:57:04 -->
