javascript - Share score on facebook -
i have application few pictures , when user check picture, gets +1 score. display total score on page code:
total score: <span id="perk1"></span>
my script is:
<script type='text/javascript'>//<![cdata[ $(window).load(function(){ var actor=0; $(document).ready(function() { $('#perk1').html(actor); $("#img100").click(function() { if($('#img100').is(':checked')) actor=actor+1; else if(actor>0) actor=actor-1; $('#perk1').html(actor); }); $("#img95").click(function() { if($('#img95').is(':checked')) actor=actor+1; else if(actor>0) actor=actor-1; $('#perk1').html(actor); }); }); });//]]>
html:
<div class="imgs"> <div class="thumb"> <label for="img100"><img src="priyanka_chopra\gunday.jpg" height="200" width="275"/></label> <input type="checkbox" class="chk " id="img100" name="img100" value="0" /> <label for="img95"><img src="priyanka_chopra\krrish3.jpg" height="200" width="275"/></label> <input type="checkbox" class="chk " id="img95" name="img95" value="0" /> </div>
everything works fine. want share facebook button can publish score on facebook. able share whole page facebook show score 0. want score saved , display in facebook dialog box or full html page.
you can pass points parameter or hash, example
and them on document load in js, or if use php parameter , generate page points.
Comments
Post a Comment