Remote Script document (reprinted from Microsoft) (ix) _ long-distance scripting

Source: Internet
Author: User
Documents: Wait method

Terminates the currently executing client script until the asynchronous remote scripting call to the specified calling object completes.

Grammar

Co.wait ()

Parameters

Co
The calling object that is generated by performing a remote scripting call.

Description

Calling this method converts an asynchronous remote scripting call into a synchronous call. If the remote scripting call is complete, the method returns immediately. This is useful if you are experiencing this in a client script-requiring results from a remote scripting call.

Example

The following script asynchronously invokes method GetNames on the Emplists page. When the call is made, it displays a message and then waits for the result.

<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>


Documents: Canceling methods

Stops a remote scripting call that is executing asynchronously.

Grammar

Co.cancel ()

Parameters

Co
A call object that is generated when a remote scripting call is executed.
Description

You can call this method during the asynchronous invocation of the remote scripting-if you decide that you no longer need to call the results asynchronously. This is useful if a user's action--such as clicking a button or requesting to roam to another page--indicates that the remote scripting call has not been invoked.

You cannot cancel a synchronous remote scripting call.

Example

<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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.