PDA

View Full Version : jquery social share script


Chadi
04-09-2013, 06:51 PM
Hey guys,

Trying to add this to my site in footer.

http://plugins.in1.com/share/demo

I'm not sure what I'm doing wrong here.

I've added this in the headinclude template

<script type="text/javascript">
$('#mydiv').share({
networks: ['facebook','googleplus','twitter','tumblr','email' ,'stumbleupon','digg']
});
</script>

<script type="text/javascript" src="clientscript/jquery.share.js"></script>
<link rel="stylesheet" type="text/css" href="clientscript/jquery.share.css" />

The paths are correct.

I added this in footer template

<div id="mydiv"></div>

Doesn't show up at all. Any ideas?

Chadi
04-10-2013, 08:21 PM
Anyone please? :)

--------------- Added 1365714587 at 1365714587 ---------------

I found an issue.

<div id="mydiv"></div>

<script type="text/javascript" src="clientscript/jquery.share.js"></script>
<link rel="stylesheet" type="text/css" href="clientscript/jquery.share.css" />

<script type="text/javascript">
$('#mydiv').share({
networks: ['facebook','googleplus','twitter','tumblr','email' ,'stumbleupon','digg']
});
</script>


The script only appears when not logged in. Once logged in, it disappears.

I've replicate this when I placed it in header, footer and showthread templates (one at a time too).

Someone mentioned this to me from another forum

The problem is that when you are logged in, jQuery is suddenly not defined, that is to say, you no longer reference the jQuery code in your page.
When you are not logged in, it is included in the hgead section of your document on line 94:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
However, when you log in, this line vanishes from the source code.

Anyone have any idea how to fix that?