tabalinas / jssocials

Social Network Sharing jQuery Plugin
http://js-socials.com
MIT License
464 stars 104 forks source link

Is there a method to reload a page once content is shared? #197

Open ahab1b opened 6 years ago

ahab1b commented 6 years ago

Hello, Is there a method that will refresh the page once content is shared. The click event handles the social buttons click. I have a popup in my code and once the content is posted I want to set a cookie and then refresh the page or even just the div element. Is there a way to do this.

My code is:

    $("#share").jsSocials({
        shareIn: "popup",
        shares: ["facebook", "twitter", "linkedin"],
        // URL to share
        url: "http://loacal",
        // text to share
        text: "text to share",
        showLabel: false,
        showCount: false,
        on: {
            click: function(e) {
                if(this.share === "facebook") {
                                      //Do something
                }
                if(this.share === "twitter") {
                                     //Do something
                }
                if(this.share === "linkedin") {
                                     //Do something
                }
            }
        }
    });

Thanks.