IE: "Exception thrown and not caught" Error
  • There is a bug in Lightview 2.5.4 . In IE's 6 - 9 you will get the error "Exception thrown and not caught" when using iframe or inline content and "lightview:loaded". To replicate this error simply download Lightview 2.5.4 and add the following javascript ("as copied from the documentation") to installation_example.html:



    document.observe("lightview:loaded", function() {

    Lightview.show({
    href: 'http://www.google.com',
    rel: 'iframe'
    });

    });



    You will see the error in IE's when initially loaded. However, if the page is refreshed it will work. It seems like it only works if the js, css, or images are cached? Any ideas?
  • Has anyone been able to replicate this yet?
  • Well, I could only come up with a hackish / rigged way to get this working by setting a timeout:



    function showLightview() {

    try {

    Lightview.show({
    href: 'http://www.google.com',
    rel: 'iframe'
    });

    } catch(error) {

    //alert(error);
    //t = setTimeout(showLightview(),1000);
    // the thought here was to rerun the lightview show() function again if previously failed

    }

    }

    document.observe("lightview:loaded", function() {

    t = setTimeout("showLightview()", 1000);

    });



    This is by no means a good or permanent fix but at the very least I hope this helps someone else.
  • Something is thrown from Object.keys, I might have to add some delay on firing lightview:loaded while looking into it. Strange that it doesn't throw all the time, maybe it has to do with opening the file locally, that's how I've replicated it.
  • Try 2.5.5. I've put a ms delay on firing lightview:loaded.

    This should be looked into further though, IE needing this delay could mean that Prototype fires its dom:loaded too quickly, something obviously isn't ready to be used at that point, might be another one of those IE quirks.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Twitter