Javascript.

Started by JoshieDaMan, August 10, 2007, 12:00:00 AM

Previous topic - Next topic

JoshieDaMan

I kept trying to put this javascript -

<!-- AddThis Bookmark Button BEGIN -->
<a href="http://www.addthis.com/bookmark.php" onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this);" target="_blank"><img src="http://s9.addthis.com/button2-bm.png" width="160" height="24" border="0" alt="AddThis Social Bookmark Button" /></a> <script type="text/javascript">var addthis_pub = 'Joshi';</script><script type="text/javascript" src="http://s9.addthis.com/js/widget.php?v=10"></script> 
<!-- AddThis Bookmark Button END -->

from http://www.addthis.com

It kept showing up error in the template. I was wanting to put it at the footer. Above the copyright of simplemachine.

Some help would be greatly appreciate.

H

Please attach your themes index.template.php
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

karlbenson

The uses of a single quote need to be escaped with a backslash

var addthis_pub = \'Joshi\';

Also it may need to be echoed aswell depending on where it falls within the template.

echo 'string';

JoshieDaMan

I don't believe "var addthis_pub" isn't the situation. Because it's javascript, I also tried other javascript code to insert the template and it showed up template error. So, I really don't know what to do now.:(

karlbenson

try


echo '<!-- AddThis Bookmark Button BEGIN -->
<a href="http://www.addthis.com/bookmark.php" onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this);" target="_blank"><img src="http://s9.addthis.com/button2-bm.png" width="160" height="24" border="0" alt="AddThis Social Bookmark Button" /></a> <script type="text/javascript">var addthis_pub = \'Joshi\';</script><script type="text/javascript" src="http://s9.addthis.com/js/widget.php?v=10"></script> 
<!-- AddThis Bookmark Button END -->';

nguirado

Where do I put the code?
<a href="http://www.nelsonguirado.com">Asymmetric blog</a>

H

index.template.php but it does require a very small amount of php knowledge.

If you're not comfortable with editing the code pleast attach your theme's index.template.php here.
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Advertisement: