admin 管理员组

文章数量: 1086019

I'm trying to implement ShareThis buttons on a page, but cannot get the basic options to work in FF or Chrome, on win 7 or Vista.

Chrome has no plugins. Have disabled FF plugins.

Not sure if the problem is some dumb mistake I'm making, or if it is with ShareIt JS code.

Steps:
1. Signed up
2. Went to
3. Completed the 3 steps (changes: Added Pinterest and removed ShareThis button
4. Created a html file and pasted the code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ".dtd">
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta http-equiv="Content-Language" content="en-us" />
      <script type="text/javascript">var switchTo5x=true;</script>
      <script type="text/javascript" src="...; /script>
      <script type="text/javascript">stLight.options({publisher: 'beea8274-700e-4d53-aeff-393478c86a40'}); </script>
   </head>
   <body>
      <span class='st_facebook_large' displayText='Facebook'></span>
      <span class='st_twitter_large' displayText='Tweet'></span>
      <span class='st_linkedin_large' displayText='LinkedIn'></span>
      <span class='st_pinterest_large' displayText='Pinterest'></span>
      <span class='st_email_large' displayText='Email'></span>
   </body>
</html>

On Page load in Firefox I get SyntaxError: An invalid or illegal string was specified. Email button popup just says 'loading....', and 'Pick one or more destinations:' has no options.

Pulled much hair out over this.

Thanks

I'm trying to implement ShareThis buttons on a page, but cannot get the basic options to work in FF or Chrome, on win 7 or Vista.

Chrome has no plugins. Have disabled FF plugins.

Not sure if the problem is some dumb mistake I'm making, or if it is with ShareIt JS code.

Steps:
1. Signed up
2. Went to http://sharethis./publishers/get-sharing-tools
3. Completed the 3 steps (changes: Added Pinterest and removed ShareThis button
4. Created a html file and pasted the code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3/TR/html4/strict.dtd">
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta http-equiv="Content-Language" content="en-us" />
      <script type="text/javascript">var switchTo5x=true;</script>
      <script type="text/javascript" src="http://w.sharethis./button/buttons...; /script>
      <script type="text/javascript">stLight.options({publisher: 'beea8274-700e-4d53-aeff-393478c86a40'}); </script>
   </head>
   <body>
      <span class='st_facebook_large' displayText='Facebook'></span>
      <span class='st_twitter_large' displayText='Tweet'></span>
      <span class='st_linkedin_large' displayText='LinkedIn'></span>
      <span class='st_pinterest_large' displayText='Pinterest'></span>
      <span class='st_email_large' displayText='Email'></span>
   </body>
</html>

On Page load in Firefox I get SyntaxError: An invalid or illegal string was specified. Email button popup just says 'loading....', and 'Pick one or more destinations:' has no options.

Pulled much hair out over this.

Thanks

Share Improve this question asked Jul 23, 2012 at 5:32 K ScandrettK Scandrett 16.5k4 gold badges42 silver badges68 bronze badges 2
  • you are not closing your script tag and some error is here <script type="text/javascript" src="w.sharethis./button/buttons...;" </script> – Mr. Alien Commented Jul 23, 2012 at 5:38
  • Thanks Mr. Alien, that was bad editing on my part. I've checked source and that script tag is properly closed – K Scandrett Commented Jul 23, 2012 at 5:45
Add a ment  | 

1 Answer 1

Reset to default 3

Have you deployed your html file on a server before testing it on a browser. If you are testing the html file directly by placing on your Desktop or some other folder, then it will not work. You need to deploy the html file to a server eg: Tomcat or whichever you are fortable with.

本文标签: javascriptAn invalid or illegal string was specified when implementing basic Sharethis codeStack Overflow