views:

888

answers:

5

The widget works fine in Firefox but it completely stops the page from being rendered in IE8.

This is the error report it gives me:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Media Center PC 3.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Timestamp: Fri, 23 Apr 2010 20:12:25 UTC

Message: 'document.getElementsByTagName(...).0' is null or not an object Line: 9 Char: 8365 Code: 0 URI: http://widgets.twimg.com/j/2/widget.js

Can anybody help?

+1  A: 

You might be interested in http://www.webdeveloper.com/forum/showthread.php?t=224530

They suggest adding defer="defer" to the script tag that loads widget.js, so that it will not load until the page is completely ready. Not sure if this is the cause of your problem or not, but it might help.

<script defer="defer" src="http://widgets.twimg.com/j/2/widget.js" type="text/javascript"></script>
GalacticCowboy
Thanks, I tried it but it hasn't helped. From googling it seems certain versions of IE have issues with the getElementsByTagName method. Will report findings.
ro
+1  A: 

The problem is a single bug, which is easily rectified, as reported by (horror!) the hyphen site.

The caveat is, you'll have to download and host the "widget.js" file yourself to do this (26.7k), but, on the sunny side - you can make fine-grained changes to the widget that the original twitter page doesn't support.

This worked for me in IE8. I had been getting the 'Object doesn't support this property or method' js error.

Rafe Lavelle
+1  A: 

I was having a problem running the Twitter List Widget on my Microsoft Internet Explorer 8 also. The widget would appear but no information inside would stream. It would work fine in FireFox or other browsers, just not in IE. The problem I found was with Twitter widget.js file that was being called from the source they provided for me to paste on my site.

The actual .js file that is on the Twitter server has an error in it that won't allow the IE browser to display the stream. I was able to fix this rather simply. I downloaded the .js file by pasting the path in my browser:

http://widgets.twimg.com/j/2/widget.js

Once I had the .js file, I opened it using notepad to view the source. The change that needs to be made is simple, use the "Find" command in notepad to look for the word "array" and when it finds the entry, make the following change:

Change the entry that says “Array.forEach” in the widget.js file to read “Array.prototype.forEach”

By adding the word "prototype" you have now corrected their mistake. Of course you can't upload the file to their server so just place it in a directory on your site and path to it directly by changing the path in your Twitter generated source to point to the .js files new location on your website.

I hope this helps! Have a great day! Brian J. www.EnjoyTheCove.com

Brian J
+1  A: 

Changing “Array.forEach” into “Array.prototype.forEach” worked for me! Thank you very much!

ROFL
+1  A: 

Thanks for that solution, Brian J. It seems like it should fix the problem, but I still get an 'Object doesn't support this property or method' js error in IE 8 even after fixing the widget.js file and self-hosting it. Anyone else find another answer?

Chris Bird