【问题标题】:I have a problem trying to integrate Paella Player with Apostrophe-CMS我在尝试将 Paella Player 与 Apostrophe-CMS 集成时遇到问题
【发布时间】:2019-06-29 04:52:32
【问题描述】:

尝试在 Apostrophe 中实施 Paella Player,我发现将资产应用到我的项目时出错。

失败的 Javascript 文件是 jquery.js。

https://github.com/polimediaupv/paella/tree/develop/javascript

这是我的错误。

Uncaught TypeError: $.cookie is not a function
    at always.js:140
    at Function.<anonymous> (jquery.js:4)
    at Function.each (jquery.js:2)
    at g (jquery.js:4)
    at wb (jquery.js:4)
    at Function.ajax (jquery.js:4)
    at Function.n.(anonymous function) [as post] (http://localhost:3000/modules/paella-player-widgets/js/jquery.js:4:12281)
    at Object.self.getTemplates (user.js:94)
    at getTemplates (user.js:6)
    at async.js:718

最后就是推送 js 资源的代码了。

module.exports = {
  extend: 'apostrophe-widgets',
  label: 'Paella player',

  construct: function(self, options) {

    self.pushAsset('script', 'swfobject');
    self.pushAsset('script', 'traceur-compiler');
    self.pushAsset('script', 'base');
    self.pushAsset('script', 'jquery');
    self.pushAsset('script', 'lunr.min');
    self.pushAsset('script', 'require');
    self.pushAsset('script', 'paella_player');
  }
};

【问题讨论】:

    标签: apostrophe-cms


    【解决方案1】:

    我找到了解决方案,我不必应用 Paella 的 JQuery 文件,因为 Apostrophe 提供给我们的 JQuery 文件就足够了。

    【讨论】:

      【解决方案2】:

      鉴于撇号 CMS 已经包含 jQueryjquery-cookie,除非您使用 apostrophe-lean-frontend 模块,否则问题可能是您在模块中再次包含 jQuery 作为资产,而 jQuery 的新声明是覆盖包含 cookie 插件的原始插件,如 here 所述。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-08-28
        • 1970-01-01
        • 2017-08-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多