Why does my page work in IE9's IE7 mode, but not in IE7 itself?

前端 未结 8 667
离开以前
离开以前 2021-02-01 05:10

I recently went live with our new home page, after heavily testing it in each of IE9\'s browser and document modes (not just compatibility mode, but actual IE7 and IE8

相关标签:
8条回答
  • 2021-02-01 05:36

    Download the free Microsoft Virtual PC and MS's free Hard Drive images containing IE 7, 8, etc... that's why they make these available.

    There seems to be a million jQuery slideshow plugins and most are compatible with IE 7.

    jCarousel is one and you can change it with CSS to look like what you have now.

    This page contains 42 various slide-show plugins.


    EDIT:

    I also recommend that the page be brought into W3C compliance before tackling the other issues.

    0 讨论(0)
  • 2021-02-01 05:36

    First: always test on the actual browser. If we're talking about ie, use a virtual machine to test it. Never rely on "compatibility modes", "ies4linux", "ies4mac", "just use wine" and such. I've had a lot, but a LOT of headaches when not using virtual machines (you can use snapshots on your virtual machines - each snapshot is a browser version. This way you can have only one image but with multiple browsers).

    Second: do this problem happens even if you remove that slideshow section from your script.js? Did you check if, after removing that section and reloading your page if it isn't a cached version of the old script.js? Sometimes a cached version is the source of all problems.

    A little hack to fool your browser into not caching script.js is to add, when calling script.js from your markup, an arbitrary number (script.js?v=100 for example, and for each modification you do with your js, you modify this number. You can check SO's source, it uses a similar approach in some sections).

    Third: try to do, before the "negation" in your script:

    alert($.browser.msie);
    alert($.browser.version);
    alert($.browser.msie && $.browser.version <= 7.0);
    

    ...and see if ie alerts something or if it raises an exception. Sometimes ie will try to interpret your javascript, and raise an unknown exception for no reason whatsoever: if you don't catch it in a try/catch block everything will break from that point to the end of the script.

    I know, it's a trial-and-error approach, but we have to isolate everything and try to understand exactly what's causing the error. If needed, repeat the third advice along the slideshow section.

    0 讨论(0)
提交回复
热议问题