質問

Using IE9 F12 developer tools, I see these errors in the console:

SCRIPT438: Object doesn't support property or method 'getElementsByTagName' 
jquery.min.js, line 16 character 59007

SCRIPT438: Object doesn't support property or method 'getElementsByTagName' 
jquery.min.js, line 16 character 59007

These errors may have nothing to do with my issue (even when the troubled code is commented out, this error appears once anyway...).

The jQuery stops executing, definitely, because none of the jQuery on the site works in IE9. It works without any issue in FF, Chrome, Safari, and on the Iphone (safari as well).

I have narrowed down the code that is breaking things to this below (I know, because everything works fine when this is gone):

            <script type="text/javascript">

                $(document).ready(function() {
                var $alertdiv = $('<div id = "alertmsg"/>');
                /*$alertdiv.text("");*/
                $alertdiv.bind('click', function() {
                    $(this).slideUp(200);
                });
                $(document.body).append($alertdiv);
                $("#alertmsg").slideDown("slow"); 
                setTimeout(function() { $alertdiv.slideUp(200) }, 10000);
                                });
            </script>

This script, when functioning on other browsers, slides down a twitter-style notification bar with a message, as defined in the alertmsg div.

Does anyone see anything that could be causing this problem in IE9 only?

役に立ちましたか?

解決

Ok, it was a bug in older versions of jQuery library ( jQuery Templates not working in IE9 RC )...

I referenced the latest jQuery (v1.6.4) - and I was instantly up and running...

Thanks all for the help!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top