简体   繁体   中英

AddThis doesn't show on Heroku

My AddThis ( http://www.addthis.com/social-plugins#.Uma2k7_h0b0 ) plugin normally shows locally but when I deploy my application on Heroku, it doesn't show.

This is the code which I use for AddThis plugin:

<script type="text/javascript">$(document).ready(function() {
    var script = 'http://s7.addthis.com/js/300/addthis_widget.js?domready=1#pubid=xxx';
    if (window.addthis){
        window.addthis = null;
        window._adr = null;
        window._atc = null;
        window._atd = null;
        window._ate = null;
        window._atr = null;
        window._atw = null;
    }
    $.getScript( script, function() {
        addthis.layers({
            'theme' : 'transparent',
            'share' : {
            'position' : 'left',
            'numPreferredServices' : 5
            }   
        });
    });
});
</script>

And my application.js looks like this:

//= require jquery
//= require jquery.ui.all
//= require jquery_ujs
//= require bootstrap
//= require fullcalendar
//= require moment.js
//= require turbolinks
//= require_tree .

Thank you.

Make sure you have your assets precompile for production after changing/created a java script file

rake assets:precompile RAILS_ENV=production

or you have appropriate setting in your config/production.rb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM