0

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?

Shackrock
  • 4,601
  • 10
  • 48
  • 74
  • 2
    can you isolate the line that causes it? there are a few options here. on a hunch -- try changing '
    ' to '
    '
    – karnyj Sep 26 '11 at 23:59
  • Any chance of a link to the site? – thirtydot Sep 27 '11 at 00:05
  • It seems to work fine for me in jsFiddle in all version of IE, including IE9: http://jsfiddle.net/jfriend00/P6TFK/. I would suggest that you change this line to be a full piece of HTML: `var $alertdiv = $('
    ');`
    – jfriend00 Sep 27 '11 at 00:05
  • @karnyj - No luck. Same to you jfriend00. What's crazy too, is that this works fine with IE8 and IE7 too... thirtydot, sorry I can't link to the site - contains private info unfortunately. – Shackrock Sep 27 '11 at 00:45
  • Also I tried commenting out other lines above...never had any luck... – Shackrock Sep 27 '11 at 02:00
  • All - please see my answer below... I needed to use the latest jQuery library =/ – Shackrock Sep 27 '11 at 02:06

1 Answers1

0

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!

Community
  • 1
  • 1
Shackrock
  • 4,601
  • 10
  • 48
  • 74
  • A Note: this was a bug I think just in version 1.5, and fixed in 1.5.1, so you don't need to update all the way to 1.6.4 to fix. [Source](http://stackoverflow.com/a/5120983/1132889) – Belladonna Sep 22 '13 at 15:18