This script applies specific attr to all links on the website. How to exclude pdf and zip files?
<p>I'm building Wordpress website where all pages are being loaded using Ajax. I'm using script created by Chris Coyer that can be found <a href="http://css-tricks.com/video-screencasts/81-ajaxing-a-wordpress-theme/" rel="nofollow">here</a>. Code below will add specific tags to all links on the website. Wordpress will try to load content from those links using Ajax. Problem is that those attributes are being applied on links to PDF and ZIP files which are meant to be downloaded, not loaded into page. </p>

<p>How I can exclude specific file formats from getting those attributes? I already tried something like this <code>$internalLinks = $("a[href^='"+siteURL+"']:not([href$=/*.pdf])")</code> but that didn't work for me. Am I doing something wrong?</p>

<p>Below is part of the original code that adds attributes. Full code can be found on this <a href="http://jsfiddle.net/Klikerko/ev6MM/1/" rel="nofollow">JSFiddle page</a>. Thanks!</p>

<pre><code>var $mainContent = $("#main-content"),
    siteURL = "http://" + top.location.host.toString(),
    $el = $("a");

function hashizeLinks() {
    $("a[href^='" + siteURL + "']").each(function() {
        $el = $(this);

        // Hack for IE, which seemed to apply the hash tag to the link weird
        if ($.browser.msie) {
            $el.attr("href", "#/" + this.pathname).attr("rel", "internal");
        } else {
            $el.attr("href", "#" + this.pathname).attr("rel", "internal");
        }
    });
};​
</code></pre>
