Reputation: 5
I have this jQuery .load to get a div from another page. However when I click the link the other page's div only shows for a split second than it reverts back to the previous page's content.
$(document).ready(function(){
$("#contact").click(function(){
$("#boxcontainer").load("contact.html #contBox");
});
});
Upvotes: 0
Views: 123
Reputation: 298106
You probably need to prevent the default behavior from happening:
$(document).ready(function(){
$("#contact").click(function(e){
e.preventDefault();
$("#boxcontainer").load("contact.html #contBox");
});
});
Upvotes: 2