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
If it’s just that ID that is causing you an annoyance, you could either change that id, or remove the duplicate when the document is loaded:
If it’s multiple ID’s, the only solution I can think of is to prefix all the ID’s within the remote page with something, or load the remote page in an IFRAME.