I’m trying to integrate a Twitter sharing button into my site and am running into errors with Internet Explorer 8.
Specifically, IE8 throws two errors: “Array length must be assigned a finite positive number” and “Object doesn’t support this property or method” which cause the widget not to render properly.
This is in Internet Explorer 8.0.6001.18904 on Windows Vista.
It throws the error on any of the search result pages on my site, Lean Domain Search:
http://www.leandomainsearch.com/search?q=boston
Here’s the code I’m using the embed it, which was taken directly from Twitter’s official button generation page:
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.leandomainsearch.com" data-text="Check out Lean Domain Search, a fast new domain search tool" data-via="mhmazur">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
Here’s a screenshot with the area where the Twitter share button is supposed to show up shown in red:
Here’s the full error message:
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
Timestamp: Sun, 5 Feb 2012 16:54:20 UTC
Message: Array length must be assigned a finite positive number
Line: 2
Char: 95
Code: 0
URI: http://platform.twitter.com/widgets.js
Message: Object doesn't support this property or method
Line: 1
Char: 6287
Code: 0
URI: http://platform.twitter.com/widgets.js
What can I do to fix this?