Remote Scripting Advanced Tutorial---referencing an ASP page as an object

Source: Internet
Author: User
To make it easier to invoke the method on the ASP page with remote scripting, you can create an object reference in the client script that contains the server method page. This allows the user to use the standard Object.Method () syntax to invoke a method that the user has exposed on its own server page.
To reference an ASP page as an object
In the client script, call the Rsgetaspobject method to pass the URL and the name of the ASP page that you want to reference as an object. The Rsgetaspobject method returns an object reference. Use the following syntax:
aspobj = rsgetaspobject (URL)
which
Aspobj the object was created with the Rsgetaspobject method. The user can later use the object in a reference to the specified page in aspname.asp.
URL of the server page whose method you want to invoke.
For example, suppose a user has a page called rsmath.asp on the server. Then a user can create an object that references it with a single statement, such as using the following JavaScript to create this statement:
Rsmath = Rsgetaspobject (".. /mypages/rsmath.asp ")
or use the following VBScript to create:
Set Rsmath = Rsgetaspobject (".. /mypages/rsmath.asp ")
If the page contains a method called Add, you can invoke a method that uses the following JavaScript syntax:
CO = Rsmath.add (Number1, number2)
or use the following VBScript syntax:
Set co = Rsmath.add (Number1, number2)
For more information about how to invoke the remote scripting method, see synchronous invocation of the remote scripting method and asynchronous invocation of the remote scripting method.

Related Article

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.