I have a menu that if you click it it loads external content then fades it in to the page. How could i tell my link that if the url is already the same to not load the any ajax at all because it would be redundant. And/or if the content loaded is already identical to not call the ajax function and have the link do nothing still. This is so that the only time the ajax is being called is if there is truly new content to be added.
The current page is “Clients” and the user tries to click the “Clients”‘s menu nav button, it reloads the content. I want it to do nothing since that is going to make the same content fade in again.
$(nav[0]).click(function(){
$("#load").load("http://imagativa.com/ #load");
$("#load").fadeIn(300);
});
Thanks
There is a couple of ways to do this. The most common is to return false at the end.
Or the other method is as follows