dojo 官方翻译 dojo/aspect
官网地址:http://dojotoolkit.org/reference-guide/1.10/dojo/aspect.html
after()
定义:after(target, methodName, advisingFunction, receiveArguments);
意义:在target的methodName方法之后执行advisingFunction方法。
define(["dojo/aspect"], function(aspect){
aspect.after(dojo, "xhr", function(deferred){
// this is called after any dojo.xhr call
});
// this will execute the original dojo.xhr method and then our advising function
dojo.xhr("GET", {...});
});
dojo.require("dojo.aspect");
dojo.aspect.after(dojo, "xhr", function(response){
...
});
before()
定义:before(target, methodName, advisingFunction);
意义:在target的methodName方法之前执行adviseingFunction。
define(["dojo/aspect"], function(aspect){
aspect.before(dojo, "xhr", function(method, args){
// this is called before any dojo.xhr call
if(method == "PUT"){
// if the method is PUT, change it to a POST and put the method in the parameter string
args.url += "?x-method=PUT";
// return the new args
return ["POST", args];
}
});
// this will execute the original our advising function and then dojo.xhr
dojo.xhr("PUT", {...});
});
around()
定义:around(target, methodName, advisingFactory);
define(["dojo/aspect"], function(aspect){
aspect.around(dojo, "xhr", function(originalXhr){
return function(method, args){
// doing something before the original call
var deferred = originalXhr(method, args);
// doing something after the original call
return deferred;
}
});
dojo.xhr("PUT", {...});
});
dojo 官方翻译 dojo/aspect的更多相关文章
- dojo 官方翻译 dojo/_base/lang 版本1.10
官方地址:http://dojotoolkit.org/reference-guide/1.10/dojo/_base/lang.html#dojo-base-lang 应用加载声明: require ...
- dojo 官方翻译 dojo/_base/array 版本1.10
官方地址:http://dojotoolkit.org/reference-guide/1.10/dojo/_base/array.html#dojo-base-array array模块dojo进行 ...
- dojo 官方翻译 dojo/domReady 版本1.10
官方地址:http://dojotoolkit.org/reference-guide/1.10/dojo/domReady.html#dojo-domready dom加载完成后,执行. requi ...
- dojo 官方翻译 dojo/json 版本1.10
官方地址:http://dojotoolkit.org/reference-guide/1.10/dojo/json.html#dojo-json require(["dojo/json&q ...
- dojo 官方翻译 dojo/string 版本1.10
官方地址:http://dojotoolkit.org/reference-guide/1.10/dojo/string.html#dojo-string require(["dojo/st ...
- dojo 官方翻译 dojo/Deferred
延迟,异步调用 官网地址:http://dojotoolkit.org/reference-guide/1.9/dojo/Deferred.html require(["dojo/Defer ...
- DOJO官方API翻译或解读-dojo/store (自定制存储器)
dojo/store 是对已存数据的访问和存储的统一接口,dojo/store意图以一个简单.易于使用和扩展的API来,替代.集合和改善 dojo/data 和dojox/storage .基于HTM ...
- Events with Dojo(翻译)
In this tutorial, we will be exploring dojo/on and how Dojo makes it easy to connect to DOM events. ...
- 现代DOJO(翻译)
http://dojotoolkit.org/documentation/tutorials/1.10/modern_dojo/index.html 你可能已经不用doio一段时间了,或者你一直想保持 ...
随机推荐
- python笔记3 - 文件操作
file 对象使用 open 函数来创建,下面说一下对文件的操作分三步: 1.打开文件获取文件的句柄,句柄就理解为这个文件 2.通过文件句柄操作文件,读取/写入文件内容 3.关闭文件. 注意: 文件打 ...
- libevent(了解)
1 前言 Libevent是一个轻量级的开源高性能网络库,使用者众多,研究者更甚,相关文章也不少.写这一系列文章的用意在于,一则分享心得:二则对libevent代码和设计思想做系统的.更深层次的分析, ...
- pycharm 授权/激活
License server: http://elporfirio.com:1017/ http://idea.imsxm.com/
- java动态编译 (java在线执行代码后端实现原理)
需求:要实现一个web网页中输入java代码,然后能知道编译结果以及执行结果 类似于菜鸟java在线工具的效果:https://c.runoob.com/compile/10 刚开始从什么概念都没有到 ...
- tfs+git
TFS+GIT 一:背景介绍 技术团队的代码管理工具原来使用的是纯TFS方案,使用两年后发现一些问题:体积太大,每次新建一个分支需要本地下载一份代码:操作不便,功能分支的建立.合并不方便,本地有很多同 ...
- Java 8 Lambda 表达式详解
一.Java 8 Lambda 表达式了解 参考:Java 8 Lambda 表达式 | 菜鸟教程 1.1 介绍: Lambda 表达式,也可称为闭包,是推动 Java 8 发布的最重要新特性. La ...
- 关于小程序报错 缺少文件,错误信息:error: iconPath=../images/home.png, file not found
事实上在小程序中,虽然你的image文件夹是和你index文件夹的父级文件夹并行的文件夹,但是你如果引用的时候,不用去遵循 ../ 或者 ./因为在小程序当中他根本不识别.所以要引用的话 ...
- 巨蟒python全栈开发-第13天 内置函数 匿名函数lambda
一.今日内容总览 1.内置函数(1):并不是每一个内置函数都是那么常用 上菜:内置函数部分//思维导图:https://www.processon.com/view/link/5b4ee15be4b0 ...
- Centos7 下Boost 1.61.0源码 配置开发环境
1 下载地址 https://sourceforge.net/projects/boost/files/boost/1.61.0/ boost_1_61_0.tar.gz 2 卸载系统自带的boost ...
- 7.javascript如何调试代码
http://www.cnblogs.com/youring2/archive/2012/08/08/2624093.html