Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to integrate share on twitter button on website

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1
    • 0
    • 336
    Comment on it

    Hello Reader's if you are developing product shopping based web portal in which you want to integrate the twitter tweet button, then this blog is very helpful to you.

    To integrate the twitter tweet button you have to follow some step as below:-

    Sharing on twitter is much easier than that of Facebook, Unlike facebook here you don't have to mention the meta keys because in twitter only the simple tweet is going to share.

    To enable the twitter button you have to put the Javascript code as written below:-

    <!-- twitter share code -->
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
    <!-- twitter share code -->

     

    Now in your html file paste the following code where you want it to be appear.

    <a href="https://twitter.com/share" class="twitter-share-button" data-url="" data-text="Mitsubishi Shogun Tipper Truck $97,750.00" data-size="small">Tweet</a>

    In the above example you can see the attribute with name data-text there is the small title. This is the title where your tweet will get the default characters. So change it to the words which you want it to be shared on twitter. It could be the title of your product also. Now when you load this file and twitter button will be generated in few seconds. When you click the button popup box will be open and your default text inside the data-text attribute will be shown in tweet box.  All you need to do is click to post button.. The output of the popup box will appear like shown in below attached screen-shot :-

    How to integrate share on twitter button on website

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: