首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > JavaScript > 简化了编写异步JavaScript

简化了编写异步JavaScript

  • 资源大小:949.74 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: javascript 编写 异步 简化

资 源 简 介

``` //Every asynchronous call requires coding callbacks. // Sample Code: // // The code below first retrieves the list of discussion groups from the rpcService in a callback // Next retrieves the list of discussions from the rpcService in another callback // Finally retrieves and processes the list of messages from the rpcService from a callback (function() { rpcService.getDiscussionGroups(); rpcService.onComplete = function(groups) { for each (var group in groups) { rpcService.getDiscusionsForGroup(group); rpcService.onComplete = function(discussions) { for each (var discussion in discussions) { rpcService.getMessages(discussion); rpcService.onComplete = function(messages) { //do something } } }; } } })(); //Compare the sample above

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP