0

我有一个脚本文件 (Shared.js),其中包含我想在其他两个 js 文件 sampleA.js、sampleB.js 中使用的函数。

Shared.js:

(function ($) {
    $.fn.extend({       
        rotaterator: function (options) {
                      .....
        }
    });
})(jQuery);

示例A.js:

function A(block) {
   $('.SomeItemAA').rotaterator({ ... });
};

示例B.js:

function B(block) {
   $('.SomeItemBB').rotaterator({ ... });
};

sampleA.js 和 sampleB.js 使用脚本标记加载到我的 asp.net mvc 4 视图中。

那么如何使用require.js来做到这一点?可能吗?

4

0 回答 0