EasyLoader
用法(Usage)
加载easyui的模块(Load EasyUI module)easyloader.base = '../'; // set the easyui base directory easyloader.load('messager', function(){ // load the specified module $.messager.alert('Title', 'load ok',2); },2);通过绝对地址加载脚本(Load script from an absolute url)
using('http://code.jquery.com/jquery-1.4.4.min.js', function(){ // ... },2);通过相对地址加载脚本(Load script from relative url)
// the script path relative to easyui directory using('./myscript.js', function(){ // ... },2);
属性(Properties)
Name | Type | Description | Default |
---|---|---|---|
modules | object | 预定义模块 | |
locales | object | 预定义的地区,用于显示语言 | |
base | string | Easyui的基目录,必须以’/’结尾。 | 基目录会被自动的设置成easyload.js的相对路径 |
theme | string | 在’themes’目录下的主题的名字 | default |
css | boolean | 定义加载模块时加载的css文件 | true |
locale | string | 地区的名称 | null |
timeout | number | 以毫秒为单位的超时值,当超时的时候触发 | 2000 |
默认的地区值(Defined locales)
af bg ca cs cz da de en es fr nl tr zh_CN zh_TW事件(Events)
Name | Parameters | Description |
---|---|---|
onProgress | name | 模块加载成功的时候触发 |
onLoad | name | 模块及他的依赖项加载成功的时候触发 |
方法(Methods)
Name | Parameter | Description |
---|---|---|
load |
module, callback |
加载指定的模块,当加载成功的时候将会调用一个回调函数。 模块参数的有效类型是: 一个模块的名称 一个数组 以.css结尾的css文件 以.js结尾的js文件 |