jQuery.load() Retrieving partial page content causes duplicate ID in DOM
- by Warren Buckley
Hello all,
I currently have a JS function that allows me to load partial content from another page into the current page using jQuery.load()
However I noticed when using this that I get a duplicate ID in the DOM (when inspecting with FireBug)
This function is used in conjuction with a Flash Building viewe so it does not contain any code to retrieve the URL from the anchor tag.
function displayApartment(apartmentID) {
$("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () {
//re-do links loaded in
$("a.gallery").colorbox({ opacity: "0.5" });
});
}
The code above works just fine in retrieving the content, however it just bugs me that when inspecting with firebug I get something like this.
<div id="apartmentInfo">
<div id="apartmentInfo">
<!-- Remote HTML here..... -->
</div>
</div>
Can anyone please suggest anything on how to remove the duplicate div?
Thanks,
Warren