Using jQuery to open all external links in a new window
<p>New to jQuery here.  I've found several web pages that come close to what I'm trying to do, but not quite.  Actually, I think the following is <em>supposed</em> to actually work, but it's saying:</p>

<pre><code>[@href^="http://"]
</code></pre>

<p>is not recognized (syntax error).  Any help?</p>

<pre><code>$(document).ready(function() {
    $('a[@href^="http://"]').filter(function() {
        return this.hostname &amp;&amp; this.hostname !== location.hostname;
    }).attr('target', '_blank');  
});
</code></pre>

<p>Thanks.</p>
