remote script文档(转载自微软)(九)

所属分类: 脚本专栏 / 远程脚本 阅读数: 381
收藏 0 赞 0 分享
文档: 等待方法

终止当前正执行的客户脚本,直到指定调用对象的异步 remote scripting 调用完成。

语法

co.wait()

参数

co 
执行 remote scripting 调用而生成的调用对象。 

说明

调用该方法将把一个异步 remote scripting 调用转换为同步调用。如果 remote scripting 调用已完成,那么该方法将立即返回。如果您在客户脚本中遇到这种情况──需要来自 remote scripting 调用的结果,那么这种调用是有用的。

示例

下面的脚本异步调用 EmpLists 页上的方法 GetNames。当发出调用后,它显示一条消息,然后等待结果。

<SCRIPT LANGUAGE="javascript" FOR="btnReport" EVENT="onclick">
empLookup = RSGetASPObject("../mypages/EmpLists.asp");
co = empLookup.GetNames(showResults);
txt1.value = "Getting employee names ..."
co.wait() // suspends client processing
</SCRIPT>


文档: 取消方法

停止某个正异步执行的 remote scripting 调用。

语法

co.cancel()

参数

co 
执行某个 remote scripting 调用而生成的调用对象。 
说明

您可以在异步调用 remote scripting 过程中调用该方法──如果您决定不再需要异步调用结果的话。如果某个用户动作──比如单击按钮或者请求漫游到另一页──指示 remote scripting 调用已经无效的话,那么这种调用是有用的。

您不能取消同步 remote scripting 调用。

示例

<SCRIPT LANGUAGE="javascript" FOR="btnReport" EVENT="onclick">
empLookup = RSGetASPObject("../mypages/EmpLists.asp");
coEmpList = empLookup.GetNames(showResults);
txt1.value = "Getting employee names, press Cancel to stop."
</SCRIPT>

<SCRIPT LANGUAGE="javascript" FOR="btnCancel" EVENT="onclick">
coEmpList.cancel()
</SCRIPT> 
更多精彩内容其他人还在看

remote script文档[转载自微软](二)

remote script文档[转载自微软](二)
收藏 0 赞 0 分享

不错的remote script文档(转载自微软)(三)

不错的remote script文档(转载自微软)(三)
收藏 0 赞 0 分享

remote script文档(转载自微软)(四)

remote script文档(转载自微软)(四)
收藏 0 赞 0 分享

remote script文档(转载自微软)(五)

这篇文章主要介绍了remote script文档的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

remote script文档(转载自微软)(六)

remote script文档(转载自微软)(六)
收藏 0 赞 0 分享

remote script文档(转载自微软)(七)

remote script文档(转载自微软)(七)
收藏 0 赞 0 分享

remote script文档(转载自微软)(八)

remote script文档(转载自微软)(八)
收藏 0 赞 0 分享

remote script文档(转载自微软)(九)

remote script文档(转载自微软)(九)
收藏 0 赞 0 分享

远程脚本 概述

我们已经介绍了Ajax,下面来简单谈谈远程脚本。你可能会想:“Ajax有什么大不了的?我早就用IFRAME做过同样的事情。
收藏 0 赞 0 分享
查看更多