solved ShareThis Syntax Error

derrickhand300
@derrickhand300
10 years ago
1,353 posts
I am generating this code from the Sharethis website- but getting an error when I try to install it

<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "5665dd4a-015b-43d0-9b22-7439e1f35e76", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>

Can anyone tell me how to format it for jamrrom?

Thank you

( my reason for generating this code is for chasing down some bugs on my site- I have disabled the ShareThis module on my site and want to try adding the code manually from the Sharethis site and see if it fixes my bug)
updated by @derrickhand300: 05/06/15 07:56:19PM
michael
@michael
10 years ago
7,800 posts
The problem is that smarty uses this format {something} so you need to put a space between { and the first letter.

try:
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({ publisher: "5665dd4a-015b-43d0-9b22-7439e1f35e76", doNotHash: false, doNotCopy: false, hashAddressBar: false });</script>
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thank you- Remember we had this once before now
Strumelia
Strumelia
@strumelia
10 years ago
3,605 posts
"The problem is that smarty uses this format {something} so you need to put a space between { and the first letter."

Wow that's a good little tip - I will try and remember that!


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 04/01/15 11:15:03AM
michael
@michael
10 years ago
7,800 posts
Yeah its going to be the main reason that javascript pasted in is going to fail. Super easy to fix up if you know why its happening. :)

Most pieces of javascript that you get from around the place make the (wrong) assumption that you will be pasting it into HTML pages.

Tags