Compare attributes title to url params
<p>I have a small plugin from the net to fetch url params:</p>

<pre><code>$.extend({
    getUrlVars: function () {
        var vars = [],
            hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;');
        for (var i = 0; i &lt; hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    },
    getUrlVar: function (name) {
        return $.getUrlVars()[name];
    }
});
</code></pre>

<p>This extracts params from url, e.g.:</p>

<pre><code>http://mysite.com/page?slideshow=video&amp;title=General Overview
</code></pre>

<p>I want to match the title param to an existing link which has the same title as the param "title", and do something if match found, in this case General Overview:</p>

<pre><code>&lt;a href="/some-colorbox-page" class="colorbox" title="General Overview"&gt;View video&lt;/a&gt;


        var isSlideshow = $.getUrlVar('slideshow');
        if (isSlideshow === 'video' &amp;&amp; $('a.colorbox', '.video').length) {
            var titleAttr = $('a.colorbox').attr('title');
            var title = $.getUrlVar('title');
            $(window).bind('load', function () {
                if (titleAttr  === title) {
                  $('a.colorbox', '.video').each(function()) {
                     $(this).trigger('click');
                  });
                }
            });
        }
</code></pre>

<p>But this doesn't work.</p>

<p>Shortly, when a visitor visit the link <code>(http://mysite.com/page?slideshow=video&amp;title=General Overview)</code>, I want to trigger an event click to an element that has the same title as the value of url param "title".</p>

<p>Note the white space between General and Overview. This thing makes the query a bit complicated. I can not control the title attributes, but may control the title param.</p>

<p>Any help would be very much appreciated.</p>

<p>Thanks</p>
