* *content seajs+Easyui Use*//** * First to see how jquery and jquery plugins are used in Seajs*/1. Jquery.jsdefine (function(Require,exports,module)) { //Original Jquery.js CodeModule.exports = $.noconflict (true);}2The . Jquery.combobox.js dependency relationship is as follows: Jquery.combobox.js relies on jquery.combo.jsjquery.combo.js jquery.panel.js, Jquery.vali Datebox.jsjquery.validatebox.js rely on jquery.tooltip.js that how to encapsulate jquery.combobox.js and dependent plug-ins? 1) Jquery.combobox.jsdefine (function(require,exports,module) {return function($) {require ("Plugins/jquery.combo"); //plug-in code }});2) Jquery.combo.jsdefine (function(Require, exports, module) {return function($) {require ("Plugins/jquery.validatebox")($); Require ("Plugins/jquery.panel")($); //Original Jquery.combo.js Code }});3) Jquery.validatebox.jsdefine (function(Require, exports, module) {return function($) {require ("Plugins/jquery.tooltip")($); //Original Jquery.validatebox.js Code }});4) Jquery.panel.js, Jquery.tooltip.jsdefine (function(Require, exports, module) {return function($) { //Original Jquery.validatebox.js/jquery.panel.js Code(function($){ ...... }) (JQuery); //Notice that you want to change jquery to $, or change the argument to jquery in Init.js }});/** * Related examples*/a) index.html<!doctype html>Seajs.use ("./init",function(init) {init.initpage ()});</script></body>b) Init.jsdefine (function(require,exports,module) {//Load Dependent modules var$ = require ("jquery"); Require ("./plugins/jquery.combobox")($); //private properties and methods varName = "Benjamin_private"; varSetName =function(name) {Console.log ("My name is" +name); } //public properties and methodsModule.exports ={name:"Benjamin_public"Initpage:function(){ $("#sel_refresh"). ComboBox ({width:150, OnSelect:function(REC) {Console.log (rec); } }); }, SetName:function(name) {Console.log ("My name is" +name); }}); c) Jquery.combobox.js and dependent plug-in code see above/** * Problem*/
A) When using Seajs+easyui, the jquery.parse.js of the Easyui framework is basically useful for each control, so it is recommended that each control adds dependency when it is added, and when changing the file, be aware that both closures in the file have to change the arguments.
b) Avoid cache settings
You can add a timestamp after the link, or you can configure it directly
Seajs.config ({
Debug:2;
});
c) Each of the control style files in this instance is not set to be loaded by the module, you can set
d) Follow-up summary of other issues added ...
Seajs + easyui [turn]