jQuery load() problem with html that contain jQuery plugin
Posted
by
Victorgalaxy
on Stack Overflow
See other posts from Stack Overflow
or by Victorgalaxy
Published on 2011-01-06T09:25:57Z
Indexed on
2011/01/06
9:54 UTC
Read the original article
Hit count: 223
jQuery
|jquery-ajax
FYI, here is my code:
[index.html]
<script type="text/javascript" src="js/script.js"></script>
[script.js]
$(document).ready(function() {
$('#buttonEphone').click(function() {
$('#apDiv2').load("ePhone.html, #content");
});
});
"ePhone.html" contain some lightbox effect. (making use of code below)
[ePhone.html]
<script type="text/javascript" src="js/prototype.lite.js"></script>
<script type="text/javascript" src="js/moo.fx.js"></script>
<script type="text/javascript" src="js/litebox-1.0.js"></script>
The Litebox plugin also required to add onload="initLightbox()" within the BODY tag of ePhone.html.
From the above code, I can load ePhone.html's content(#content div) to my (apDiv2) of my index.html. However, the lightbox effect is no longer work. I've also try loading the whole html instead of only #content: $('#apDiv2').load('ePhone.html'); but it still doesn't work.
Please help, thx
© Stack Overflow or respective owner