asp.net - why only "main" work in require.js? define("main", ['jquery'], function () -
i had define require.js testing purpose
define("test", ['jquery'], function () { debugger; $('#button').bind('click', function () { alert("halo"); }); }); if use word "test", had javascipt file "test.js", not working if use word "main"
define("main", ['jquery'], function () { debugger; $('#button').bind('click', function () { alert("halo"); }); }); it works great, either in asp.net form or external js file, still can't it. guide refer doing wrong? declare in path.config in main.js
require.config({ baseurl: '../scripts/lib/', paths: { 'jquery': 'jquery-2.0.0', } });
ok, still new require.js, , yesterday did self test, , browse through different guideline, , figure out answer define(target js, [array of js]), thats reason why "main" work jquery inside main.js, puzzle solved
Comments
Post a Comment