I’ve got some complex AJAX going in a project that is fetching inner page content from a WordPress blog (the whole site is on WordPress) and I’m using jQuery’s .live() as a substitute for click events because the DOM is being replaced after page load via AJAX (therefore nullifying the .click() event.
I’m using http://fancyapps.com Fancybox v2 plugin and wrapping the call to initiate the plugin with .live(). The plugin should make the image and video links appear inside a modal popup box (as opposed to externally linking to them). You can see the site in development at: http://dreamstartest.net
The most unusual thing about this bug is that the script was working until recently and I’m going insane trying to find out what I changed in the code to break the functionality. Below is the code to initiate the plugin, but this code has not been changed, can anyone point out a way to debug why the .live() event is not firing – I’m using Chrome Developer tools and not getting any errors.
Again, you can see the live site at: http://dreamstartest.net
EDIT Apologies, I forgot to specify – you can click the image with the PLAY button over top of it toward the top left corner, that should be a Fancybox modal overlay when clicked.
you can put
debuggerinside the.live()callback, and see where it takes you step-by-step within the execution level on chrome dev tools. you can analyze what’s wrong with the code, and check what really is happening when you the click handler inside live() gets invoked.