微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

getScriptSet

程序名称:getScriptSet

授权协议: 未知

操作系统: 未知

开发语言:

getScriptSet 介绍

Extends jQuery with our custom multi-resource asynchronous script receiver.

It ensures that the onLoaded callback will only be executed when all scripts
have been loaded. It also maintains a cache of already loaded URL’s to prevent
multiple downloads. It also supports loading script that have their own
loading mechanism, like Google Maps, by offering a way to take their callback
and inject it into ourselves.

Resources are passed in the following style:

`[
“simple_javascript_file.js”,
{
url: ‘js_file_with_own_loader’,
callbackSetter: function(callback) {
// The callback parameter is the callback that ‘js_file_with_own_loader’
needs
// to call when it completes. So you Could do it like this for example:
module.addListener( ‘onLoad’, callback ) ;
// Or you can check the example below for how it works with Google Maps e.g.
}
}
]

This is a sample resource deFinition for loading Google Maps with our own
custom script that extends the Google Map object:

[ “my_google_maps_extension.js”,
{ url: "http://maps.google.com/maps?file=api&v=2&key=” + GMAP_KEY +
“&async=2&callback=_gmapsOwnOnLoadCallback”,
callbackSetter: function(callback) { self._gmapsOwnOnLoadCallback = callback }
} ]`

getScriptSet 官网

http://plugins.jquery.com/project/getScriptSet

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐