Tuesday, 21 February 2012

Share on Facebook and Twitter


Sharing your web page on Facebook and Twitter code follows:



<a href="http://www.facebook.com/share.php?u=<;url>" onclick="return fbs_click()"><img src="images/fshare.png" title="Share To Facebbok" alt="Share To Facebbok" width="84" height="29" /></a>


<a id="aTweet" href="https://twitter.com/share" data-count="none" onclick="return Tweet_click()"><img src="images/retweet.png" title="Tweet" alt="Tweet" width="29" height="29"/></a>



<script type="text/javascript">

function fbs_click()

{

    u = location.href;

    t = document.title; window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');

    return false;

}

function Tweet_click() {

    u = location.href;

    t = document.title; window.open('https://twitter.com/share?url=' + encodeURIComponent(u) + '&amp;via=' + encodeURIComponent(t), 'sharer','toolbar=0,status=0,width=626,height=436');

    return false;

}

</script>



Tag: button, facebook share, fb share, fbs_click(), share, share on facebook, Tweet_click(), twitter share



No comments:

Post a Comment

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...