0

I included a Twitter button on my page, using the code from https://about.twitter.com/resources/buttons

A very basic implementation looks like this

<!DOCTYPE html>
<html>

<head>
</head>

<body>

<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
<script>!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>

</body>

</html>

Is runs perfectly in all browsers, except IE8, where it triggers an error: SCRIPT1010: Expected identifier File: widgets.js, Line: 1, Column: 29036

in file https://platform.twitter.com/widgets.js

I don't see how my implementation could be wrong. Does anyone have an idea or is this really an IE8 bug in the Twitter code?

PepeNietnagel
  • 230
  • 2
  • 10
  • find duplicate question http://stackoverflow.com/questions/28205278/twitter-widgets-js-throws-javascript-error-expected-identifier-on-ie8 – PepeNietnagel Feb 02 '15 at 21:46

1 Answers1

1

According to Twitter widgets.js throws JavaScript error "Expected identifier" on IE8, Twitter stopped supporting IE8 in January 2015.

My "solution" was therefore to use conditional comments <!--[if gt IE 8]><!--> TWITTER CODE HERE <!--<![endif]--> to disable the tweet button in IE8 and lower.

Community
  • 1
  • 1
PepeNietnagel
  • 230
  • 2
  • 10