• On a CPT’s post editor page (wp-e-commerce product editor), there’s some glitch occurring where anywhere I click on the page triggers a script that opens a lightbox, making the page unusable. How can I track down what’s going on? How do I pinpoint where the javascript gets triggered? I commonly use Visual Event to look at elements with events attached, but nothing’s showing up through there.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Use developer tools in Chrome or IE and Firebug in FF.

    Thread Starter Gabe462

    (@gabe462)

    I am. I use Chrome dev tools regularly, and used to use Firebug. MAybe this is just something I’ve not yet learned to do in either.

    I’m familiar with the debugger, but only know how to us breakpoints in areas of code that I’m already looking at. If there is a way to simply break at the next executed line of JS, I’d love to know what that is!

    Thanks

    So this is a WP plugin? Check scripts in source code?

    Thread Starter Gabe462

    (@gabe462)

    Doing that. It looked like Thickbox was doing the work, so I unenqueued it and it sort of stopped happening (while other things broke). So I set a few breakpoints at the beginnings of functions in thickbox and watched what happened when I clicked on the page.

    This bit from thickbox looks like it could be doing some damage if domChunk isn’t being properly

    function tb_init(domChunk){
    	jQuery('body').on('click', domChunk, tb_click);
    }
    Thread Starter Gabe462

    (@gabe462)

    Yea, I know what thickbox is, and I actually found a workaround for the issue- I commented out the line in the plugin where it calls the tb_init() above. But I’d wanted to have a more advanced technique for troubleshooting this from the frontend. I try to avoid editing plugin code, so I’d have liked to unhook whatever events were hooked to whichever element. I think I can probably figure that out now with some trial and error, but I’ve got to move on.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how to find JS event (glitch) attached to entire page’ is closed to new replies.