Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery EasyUI Basic Plugins - Easyloader

jQuery EasyUI Basic Plugins - Easyloader


jQuery EasyUI Plugins jQuery EasyUI Plugins


Usage

Loading EasyUI Modules



easyloader.base = '../'; // 设置 easyui 的基本目录

easyloader.load('messager', function(){ // 加载指定的模块

    $.messager.alert('Title', 'load ok');

});

Load scripts via an absolute url



using('http://code.jquery.com/jquery-1.4.4.min.js', function(){

    // ...

});

Load scripts via a relative url



// Path of the script relative to the easyui directory

using('./myscript.js', function(){

    // ...

});

property

Name Type Description Default value
modules object Predefined modules.
locales object Predefined locales.
base string The base directory of easyui, which must end with '/'. The base directory will be set automatically relative to easyload.js
theme string The theme name defined in the 'themes' directory. default
css boolean Defines whether to load css files when loading modules. true
locale string The locale name. null
timeout number The timeout value in milliseconds; triggered if a timeout occurs. 2000

The defined locale

Events

Name Parameters Description
onProgress name Triggered when a module is loaded successfully.
onLoad name Triggered when a module and its dependencies are loaded successfully.

Method

Name Parameters Description
load module, callback Load the specified module. A callback function will be called when loading succeeds.
 module 参数的有效类型是:       

 单个 module 名称       

 一个 module 数组       

 用 '.css' 结尾的 css 文件       

 用 '.js' 结尾的 js 文件 |


jQuery EasyUI Plugins jQuery EasyUI Plugins