jQuery: .load() invoked twice?
I am really confused with what's happening. My code is very basic yet the result开发者_如何学Go seems to be very complex :-\
$j.ajaxSetup ({
cache: false
});
var $img = $j('.infiniteCarousel-vid ul li img:not(.noimg)');
var loadUrl = "http://shorelinerenovations.com/wp-content/themes/Narm/videos/load_vid.php";
$img.click(function(){
$j('.vid-preview').load(loadUrl);
});
Feel free to visit the page where I am implementing this: http://shorelinerenovations.com/project-1 . The styling is very buggy as of the moment so forgive me. When you click on one of the image previews at the very bottom, you'll see the video is being loaded twice :-\
Is this script loaded and run twice?
Load()
is in the click handler (the anonymous function you've passed to click()
), if it is being run twice, it is probably being registered twice.
精彩评论