How to debug in IE7? No errors, no shadowbox

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to debug in IE7? No errors, no shadowbox

Wintermute-2
Using Shadowbox in conjunction with Prototype:

JS:
================================================================
document.observe("dom:loaded", function() {

        if (($$('[rel="shadowbox"]')) || ($$('[rel="shadowbox[casestudy]"]'))){
               
                alert($$('[rel="shadowbox[casestudy]"]'));

                var shadowboxOptions = {overlayBgImage: 'images/overlay-85_white.png', overlayColor: '#FFFFFF'};
                Shadowbox.init(shadowboxOptions);
        }
});
================================================================


HTML:
================================================================
Anorak
View larger »

================================================================

This code works fine in FF, Opera, Safari... on IE7 I get nothing. Well, the image opens in a new browser window. I get no error messages, I get no Shadowbox.

I'm at a loss as to how to go about debugging this. As you can see, I've got as far as dropping an alert() in, to check that the IF statement is returning true. It is, and it's alerting a bunch of hrefs.

Why isn't it working in IE? How can I find out where it's going wrong?
Reply | Threaded
Open this post in threaded view
|

Re: How to debug in IE7? No errors, no shadowbox

Wizzud
Try taking out the if and the alert, and just running the options setup and the init().
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: How to debug in IE7? No errors, no shadowbox

Wintermute-2
Why?

Like I said, the IF returns true. I know this because the alert pops up and lists a bunch of elements that match the CSS selector.

What I want to know is if IE is having problems attaching the onclick events to those elements, or whether the onclick is firing but Shadowbox is having problems opening its window. But I don't know enough about Shadowbox's internal workings to know what I should be debugging.

Reply | Threaded
Open this post in threaded view
|

Re: How to debug in IE7? No errors, no shadowbox

Wizzud
there's a function called Shadowbox.setup
there's another function called handleClick

both are fairly obvious as to what they do

do you have a valid DOCTYPE?
do you have an example of a link that isn't being picked up (first post HTML is unreadable, and view source shows no evidence of a rel with shadowbox in it)?
Combine literacy with curiosity and a whole world of information opens up to you