JQuery - get page?
<p>I nearly have this going but don't have sufficient brain power to work out the final step.</p>

<p>This is what happens at the moment.</p>

<p>1) Page loads
2) When a link is clicked, a hash is added to the url with the page id. This is saved to the browser history.</p>

<p>I have the Ajax call set up, if I attach it to the link function it works fine. The problem is getting the id from the url. Here is what I have.</p>

<pre><code>var id = urlToId(window.location);
if (id != undefined) {
    go(id);
}

function urlToId(url) { alert(url);
    var segments = url.split('#'); alert(segments);
    var id = segments[1];
    return id;
}
</code></pre>

<p>alert(url) = <a href="http://localhost/site/index.php?p=1#1" rel="nofollow">http://localhost/site/index.php?p=1#1</a>
-- Javascript Error: url.split is not a function.</p>

<p>I sense that if I can just get rid of the JavaScript error I should be golden.</p>
