Multi Social Share JS

Simple dependency free multi social share script

Integration


Add meta tags


    <html>
        <head>
            ...
            <meta name="title" content=""/>
            <meta name="image" content=""/>
            <meta name="description" content="">
            <meta name="app-name" content=""/>
            <meta name="app-hash-tags" content=""/>
        </head>
        <body>
        ...
        </body>
    </html>
        

Download and add script


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <script src="multi-social-share.js"></script>
        </body>
    </html>
        

Add share button or anchor tag


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.facebook(); return false;"> Share from button </button>

        <a href="" onclick="Share.facebook();"> Share from anchor tag </a>
        ...
        </body>
    </html>
        

Examples

Facebook


Share on facebook


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.facebook(); return false;"> Share on facebook </button>

        <a href="" onclick="Share.facebook();"> Share on facebook </a>
        ...
        </body>
    </html>
        


    Share.facebook({
        url: '' // default current location
    });
        

Twitter


Share on twitter


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.twitter(); return false;"> Share on twitter </button>

        <a href="" onclick="Share.twitter();"> Share on twitter </a>
        ...
        </body>
    </html>
        


    Share.twitter({
        url: '', // default current location
        title: '', // default title meta tag
        via: '', // default app-name meta tag
        hashtags: '' // default app-hash-tags meta tag
    });
        

Google


Share on google


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.google(); return false;"> Share on google </button>

        <a href="" onclick="Share.google();"> Share on google </a>
        ...
        </body>
    </html>
        


    Share.google({
        url: '' // default current location
    });
        

Pinterest


Share on pinterest


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.pinterest(); return false;"> Share on pinterest </button>

        <a href="" onclick="Share.pinterest();"> Share on pinterest </a>
        ...
        </body>
    </html>
        


    Share.pinterest({
        url: '', // default current location
        title: '', // default title meta tag
        image: '' // default image meta tag
    });
        

LinkedIn


Share on linkedIn


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.linkedIn(); return false;"> Share on linkedIn </button>

        <a href="" onclick="Share.linkedIn();"> Share on linkedIn </a>
        ...
        </body>
    </html>
        


    Share.linkedIn({
        url: '', // default current location
        title: '' // default title meta tag
    });
        

BufferApp


Share on bufferApp


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.bufferApp(); return false;"> Share on bufferApp </button>

        <a href="" onclick="Share.bufferApp();"> Share on bufferApp </a>
        ...
        </body>
    </html>
        


    Share.bufferApp({
        url: '', // default current location
        title: '' // default title meta tag
    });
        

Tumblr


Share on tumblr


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.tumblr(); return false;"> Share on tumblr </button>

        <a href="" onclick="Share.tumblr();"> Share on tumblr </a>
        ...
        </body>
    </html>
        


    Share.tumblr({
        url: '', // default current location
        title: '', // default title meta tag
        description: '' // default description meta tag
    });
        

Reddit


Share on reddit


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.reddit(); return false;"> Share on reddit </button>

        <a href="" onclick="Share.reddit();"> Share on reddit </a>
        ...
        </body>
    </html>
        


    Share.reddit({
        url: '', // default current location
        title: '' // default title meta tag
    });
        

StumbleUpon


Share on stumbleUpon


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.stumbleUpon(); return false;"> Share on stumbleUpon </button>

        <a href="" onclick="Share.stumbleUpon();"> Share on stumbleUpon </a>
        ...
        </body>
    </html>
        


    Share.stumbleUpon({
        url: '', // default current location
        title: '' // default title meta tag
    });
        

Evernote


Share on evernote


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.evernote(); return false;"> Share on evernote </button>

        <a href="" onclick="Share.evernote();"> Share on evernote </a>
        ...
        </body>
    </html>
        


    Share.evernote({
        url: '', // default current location
        title: '' // default title meta tag
    });
        

Email


Share on email


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.email(); return false;"> Share on email </button>

        <a href="" onclick="Share.email();"> Share on email </a>
        ...
        </body>
    </html>
        


    Share.email({
        url: '', // default current location
        title: '', // default title meta tag
        description: '' // default description meta tag
    });
        

Wordpress


Share on wordpress


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.wordpress(); return false;"> Share on wordpress </button>

        <a href="" onclick="Share.wordpress();"> Share on wordpress </a>
        ...
        </body>
    </html>
        


    Share.wordpress({
        url: '', // default current location
        title: '', // default title meta tag
        description: '', // default description meta tag
        image: '' // default image meta tag
    });
        

Pocket


Share on pocket


    <html>
        <head>
            ...
        </head>
        <body>
        ...
        <button onclick="Share.pocket(); return false;"> Share on pocket </button>

        <a href="" onclick="Share.pocket();"> Share on pocket </a>
        ...
        </body>
    </html>
        


    Share.pocket({
        url: '', // default current location
        title: '' // default title meta tag
    });