AddThis不会在Heroku上显示

时间:2021-08-02 20:25:49

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.

我的AddThis(http://www.addthis.com/social-plugins#.Uma2k7_h0b0)插件通常在本地显示,但是当我在Heroku上部署我的应用程序时,它没有显示。

This is the code which I use for AddThis plugin:

这是我用于AddThis插件的代码:

<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:

我的application.js看起来像这样:

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

Thank you.

1 个解决方案

#1


1  

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

更改/创建java脚本文件后,请确保已将资产预编译用于生产

rake assets:precompile RAILS_ENV=production

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

或者你的config / production.rb中有适当的设置

#1


1  

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

更改/创建java脚本文件后,请确保已将资产预编译用于生产

rake assets:precompile RAILS_ENV=production

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

或者你的config / production.rb中有适当的设置