How to invoke a remote ASP without refreshing the page

Source: Internet
Author: User
Tags requires
A concrete example of RS technology
In the previous post, I introduced the basic principle of RS, obviously if the RS technology used in a
The design of the website will have a lot of extraordinary effect (especially its biggest advantage, can not refresh
page, invoke the server-side code. It is because of this feature that you can write a
The traditional C/S model of the program, like the data processing of the database (I think we must be very want to know how to achieve the specific, the following will give a concrete example, debugging this broken program almost quickly put me to death, hehe. )
As you can see from the previous description, using RS technology requires the client and server to meet the following two conditions:
1. The client only needs to support Java applets
2. And the server only need to support ASP can
In other words, the RS technology is completely independent of the browser (of course the browser needs to at least meet the support Java
and JavaScript), you can use it in IE, or you can completely
NC, which is a notable feature of the distinction and RDS technology.
Before you can use RS technology flexibly, it is a problem to illustrate that the "asynchronous invocation" mentioned earlier
The problem. It is because of the asynchronous invocation that you can only refresh a part of the page without refreshing
The entire page.
Because of this feature, you can enable the server to achieve while you are browsing the page
Check the legality of your input data (this can, of course, be a series of very complex legality checks, such as needing
The data entered by the user and the data in the database are compared, etc., this is not the client's JS can be resolved.
Then when the server returns the results of the check, you do the appropriate action (such as a pop-up dialog box to tell the user
Input error, etc.)
The syntax for an asynchronous call is as follows:
Rsexecute (ServerURL, functionname, Param_list)
The first parameter is the full URL path of the ASP page you want to invoke
The second argument is the name of the function you want to call
The following is the input parameter that the function needs.
If the function you want to call requires two input parameters, this is the way it is written:
Rsexecute (ServerURL, functionname, f_arg_1, f_arg_2)
There are two ways to do this when the call is made,
One is the invocation of a return result:
Objresult = Rsexecute (ServerURL, functionname, f_arg_1, f_arg_2);
The other is a way of calling that does not return results:
Rsexecute (URL, func_name, f_arg_1, F_arg_2, callbackfunction);
This type of invocation should be specially noted, where the callbackfunction is a JS function of the client
It represents a call to the server at the end of the RS execution, and the function is called immediately and the result is returned to the
function.
A typical callbackfunction function should be such a structure:
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.