开发者

MooTools DOMReady not firing in IE7 if attached after DOM is ready through yepnope

开发者 https://www.devze.com 2023-03-17 08:32 出处:网络
I am using yepnope to load my scripts, but when using IE7, it won\'t fire the Mootools domready OR load events if they have already been fired. Any idea why?

I am using yepnope to load my scripts, but when using IE7, it won't fire the Mootools domready OR load events if they have already been fired. Any idea why?

Here is the code.

yepnope([
    {
        load: "/js/uncompressed/mootools.js",
        callback: function () {
            if (Browser.ie && Browser.version.toFloat() < 8) {
                yepnope([
                    {
 开发者_如何学编程                       load: "/js/uncompressed/ie.js",
                        complete: function () {
                            window.addEvent("domready", function () {
                                setupForIE();
                            });
                        }
                    }
                ]);
            }
        }
    }
]);

Using MooTools version 1.3.2 (no compat) and yepnope bundled with Modernizr.

After more testing, it seems that IE9 and IE8 aren't firing the domready either.


Because you are loading Mootools "Asyncronously", maybe the js-Library loading after the DOMContentLoaded - event has already fired, thus your function not got executed.

0

精彩评论

暂无评论...
验证码 换一张
取 消