Search code examples
javascriptjqueryhtmlsharethis

ShareThis button not working on mobile, when I click on it there's no modal window or popup


I made this website with Laravel. There is a custom ShareThis button on the site for sharing things. It's working properly on my desktop machine, but it doesn't seem to do anything on my mobile.

These are in the head tag:

    <script type="text/javascript">var switchTo5x=true;</script>
    <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
    <script type="text/javascript">stLight.options({publisher: "a499bbb4-baeb-49f5-9211-1489057bb6b5", doNotHash: false, doNotCopy: false, hashAddressBar: false, onhover: false});</script>

This is the custom button:

    <span class='st_sharethis_custom' st_url="{{ url('/'.$quote->quote_id) }}" st_summary="{{ $quote->quote_text or "" }}" id="sharethis"><div class="round-share"><i class="fa fa-share-alt" aria-hidden="true"></i></div></span>

I also tried to assign the CSS directly to the span tag but neither is working on mobile:

    <span class='round-share st_sharethis_custom' st_url="{{ url('/'.$quote->quote_id) }}" st_summary="{{ $quote->quote_text or "" }}" id="sharethis"><i class="fa fa-share-alt" aria-hidden="true"></i></span>

Solution

  • I moved my page from http to https and this caused the problem.

    I needed to change this line:

     <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
    

    To this line:

    <script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>