js callback , ajax call back can observer mvvm
来源:互联网 发布:淘宝主图背景图片大全 编辑:程序博客网 时间:2024/06/06 19:42
Refer : http://www.jb51.net/article/59447.htm
do something other || like android network after the net work down do some thing by param but android only can pass the param by interface callBack just like click event android -- web { class Demo{ network(fun){ setTimeout(()=>{ fun.call(this); },3000) } } new Demo().network(()=>{ alert(1); }) }
带参数的也比较简单
do something other || like android network after the net work down do some thing by param but android only can pass the param by interface callBack just like click event android -- web { class Demo{ network(fun){ setTimeout(()=>{ // use obj where in call the function and pass param fun.call(this,"d"); },3000) } } // todo:// --> you can get the return value by this way new Demo().network((e)=>{ alert(e); }) }
var _$ = function (id) { this.ele = document.getElementById(id); } // the prototype method need after new _$.prototype = { dod:function () { alert(1); }, bind:function (eve,callback) { this.ele.addEventListener(eve,()=>{ callback.call(this,this.getX()); }); }, getX:function (e) { let eve = e||window.event; if(eve.pageX) { return 1; }else{ return 0; } } } //why not rename window.$=function(id) { return new _$(id); }
0 0
- js callback , ajax call back can observer mvvm
- Call Back Callback - 整合AjaxHepler到NBear
- js中callback.call()和callback()的区别
- 315. No one can call back yestoday. 昨日不能重现
- CALL BACK
- call back function
- activity call back
- call back function
- Call back function
- Js AJAX call code behind Web Method
- js callback
- js callback
- ASP.NET 2.0当中的Call back技术与ASP.NET AJAX
- ASP.NET 2.0当中的Call back技术与ASP.NET AJAX
- ASP.NET 2.0当中的Call back技术与ASP.NET AJAX
- ASP.NET 2.0当中的Call back技术与ASP.NET AJAX
- ASP.NET 2.0当中的Call back技术与ASP.NET AJAX
- ASP.NET 2.0当中的Call back技术与ASP.NET AJAX
- 历届试题 错误票据
- csdn如何转载别人的文章
- 46. Permutations(unsolved)
- wordpress修改固定链接之后 无法访问的解决办法 标签: WordPress 2015-09-24 14:09 223人阅读 评论(0) 收藏 举报 分类: WordPress(6) 本地同
- java日志组件介绍(common-logging,log4j,slf4j,logback )
- js callback , ajax call back can observer mvvm
- C++智能指针
- zookeeper学习之路一
- 算法提高 学霸的迷宫
- Mac 双系统分区合并
- CSS3中轻松实现渐变效果
- Git的安装与配置
- tty1
- JavaScript必备