I am building ajax based navigation and everything works fine except for one thing:
When I look in Firebug, I see that with each click on the site ajax is called and loaded twice.
This is the script:
$(document).ready(function () { //Check if url hash value exists (for bookmark) $.history.init(pageload); //highlight the selected link $('a[href=' + document.location.hash + ']').addClass('selected'); //Seearch for link with REL set to ajax $('a[rel=ajax]').click(function () { //grab the full url var hash = this.href; //remove the
Therefore, whenever I click on a list in my navigation, the page loads just fine in #main, but it happens twice (as shown in Firebug). Maybe Any1 has an idea why? :)
I noticed that this does not happen when I access a specific page by url (than only one ajax call does this), so I think the problem is somewhere in the click function.
ps I use the jquery history plugin, but I donβt think there is a problem or?
source share