Twitter button works in Chrome and Safari, but not IE or FX

446 views Asked by At

I have a website which holds both Facebook and Twitter share buttons. When loaded in Chrome I see both, when loaded in IE and Firefox I only see the Facebook Share. These buttons use code generated directly from both developers website. Specifically my generated twitter code is:

<a id="someID" class="twitter-share-button" data-url="http://correct.url" data-via="" data-text="Some site specific text" href="https://twitter.com/share">Tweet</a>
<script type="text/javascript">
!function (d, s, id)
{ var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } } (document, 'script', 'twitter-wjs');
</script>

In the console of all browsers I get:

Received message of type object from http://platform.twitter.com, expected a string

But chrome and safari still manage to load the Twitter Buttons. (Perhaps they auto convert the returned object to string)

More details:

  • The buttons are loaded via AJAX. I call twttr.widgets.load(); at the end of every Ajax call (in addition to the FB.XFBML.parse();).
  • I have removed all plugins/addons from browsers, and seen no change.
  • Using ASP.NET 4.5
  • Inspecting the DOM I see the twitter iframe with display:hidden

Any help is greatly appreciated.

1

There are 1 answers

0
Jeff Schwarting On

You may have share functionality already in place that's causing conflicts.

I had the exact same error message, tried a bunch of stuff which didn't work, and eventually disabled the other share buttons on the page, which fixed all my issues.