So this is the first site I have done where content is delivered via AJAX and internal links are caught by
$("a:not([href^='http://'])").click( function(e) {
var url = $(this).attr("href");
var title = ($(this).attr("title")) ? ': ' + $(this).attr("title") : '';
e.preventDefault();
if(url!=window.location){
window.history.pushState({path:url},title,url);
$('#contentMain').load(url);
document.title = "It's New Orleans" + title;
}
});
For some reason it does work once to click a link with the class but the second time gets preventDefault()ed.
<a href="#" ajax-data="/audio/foo.mp3" class="playerLink">Listen</a>
The fix was adding [href^='#']
to not() e.g.
$("a:not([href^='http://'],[href^='#'])").click( function(e) {