Remote Scripting Advanced Tutorial---Invoke Remote Scripting method synchronization

Source: Internet
Author: User
Invoke Remote Scripting Method synchronization
Once you have configured a remote scripting on a customer page and on a server page, you can invoke the Server page's method from your own client script. By default, when a user invokes a server method, it is executed synchronously--your client script does not stop running until the server method completes and returns the result. Generally speaking, when you need server method results in your own client script, you need to synchronize the call to the server method.
Note You can also invoke the server method asynchronously. For more information, see Calling the Remote scripting method asynchronously.
When you call a server method, the method does not return a single value. Instead, you create a call object, which is an object that contains the return and state information of the invoked procedure. The most commonly used property is the Return_value property of the calling object, which contains a remote procedure calculation or a single value that is checked out. Other invocation object properties allow users to get more information about the status of remote procedure calls.
If you have created an object reference to a server page, you can invoke the method with the standard Object.Method syntax. For more information about creating object references, see referencing ASP pages as objects. Alternatively, you can invoke the remote scripting method when there are no object references. This is slightly more redundant than using the Object.Method syntax, but does not require the user to first create an object reference.
Synchronous Call Server method
If a user creates an object reference to a server page, the first syntax example is available for calls that use JavaScript, and for calls that use VBScript, a second syntax example is available:
Javascript:
CallObject = Aspobject.methodname (P1, p2[,...])
VBScript:
Set callobject = Aspobject.methodname (P1, p2[,...])
Or
If the user does not create an object reference, call the Rsexecute function. For calls that use JavaScript, use the first syntax example, and for calls that use VBScript, use the second syntax example:
Javascript:
CallObject = Rsexecute (URL, methodname, p1, p2[,...])
VBScript:
Set callobject = Rsexecute (URL, methodname, p1, p2[,...])
which
CallObject the name of the calling object that will be instantiated after the remote scripting call completes. You do not need to create the object before calling remote script, which is created for you by a remote scripting call.
Aspobject an object reference that you can optionally create earlier using the Rsgetaspobject method. For more information, see Referencing an ASP page as an object.
The URL contains the ASP page URL for the remote script you want to execute. The server page must be configured so that the Remote scripting in the Server page is valid as described in. The server page must be on the server from which the user requests the current customer page.

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.