Thursday, April 9, 2009

Duplicate content of Ajax call using facebox with jQuery in Internet Explorer

Problem: In Internet Explorer 7, populating once facebox lightbox using Ajax call works fine but if I repeat that calls it starts duplicating the content of the lightbox, gave impression that it appends new call at the end of already populated content and only doing hide and show of the lightbox content.

Solution: After debugging I noticed that in my Ajax call I am calling a whole web-page including HTML and BODY pair tags. So removing HTML tags and only fetching relevant DIV content solved my problem :)

1 comment:

thethinkingman said...

Hey - I happen to be experiencing the same issue and am not particularly familiar with Javascript enough to implement what you speak of.

That is, I am implementing facebox through the "rel" attribute in anchor tags, thus the whole page is *always* fetched.

How would i go about fetching only the desired div itself?

Thanks SO much in advance for any help you can provide!

mzjunkacct at g m a i l dot c o m