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
1 Answer
Reset to default 3Have 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.
版权声明:本文标题:javascript - An invalid or illegal string was specified when implementing basic Sharethis code - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744091981a2532204.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论