main.js:

require.config({
  paths: {
    jquery: 'jquery-1.7.2',
    biz: 'biz',
  }
});

require(['jquery', 'biz'], function ($, biz) {
  //$("#msg").text("依赖加载完成了。");这里有点象依赖注入的组装
  biz.changeRemark($, "我想我是海。");
});

//--------------------------------------------------

define(["jquery"], function () {
  //这里定义了依赖jquery
  return {
 
    changeRemark: function(jquery, content) {
      console.info("传入参数:" + content);
      jquery("#Remark").text(content);
    }
 
  };
});
//--------------------------------------------------

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案