未捕获错误:没有定义显示调用

时间:2013-09-27 05:31:46

标签: javascript jquery backbone.js requirejs

这就是我在main.js中所做的:

requirejs.config({
enforceDefine: true,
paths: {
    "jquery": "libs/jquery/jquery-min",
    "underscore": "libs/underscore/underscore-min",
    "backbone": "libs/backbone/backbone-min",
    "reveal":"libs/jquery/jquery.reveal"

},
shim: {
    "underscore": {
        deps: [],
        exports: "_"
    },
    "backbone": {
        deps: ["jquery", "underscore"],
        exports: "Backbone"
    },
    "reveal": {
        exports: "Reveal"
    }

}
});

未捕获错误:没有定义显示调用 http://requirejs.org/docs/errors.html#nodefine

知道可能导致这种情况的原因。感谢。

1 个答案:

答案 0 :(得分:2)

查看enforceDefine property的API。您的reveal填充程序未将jQuery指定为依赖项,并且额外属性还要求您正确导出它:

"reveal": {
    deps: ["jquery"],
    exports: "jQuery.fn.reveal"
}