A specific example of RS technology
In the previous post, I introduced the basic working principle of RS. Obviously, if RS technology is applied to the design of a
website, it will have many extraordinary effects ( Especially its biggest advantage is that it can call the server-side code without refreshing the
page). It is precisely because of this feature that you can process the data in the database just like writing a
traditional C/S mode program (I think everyone must want to know how to implement it, below. To give a specific example, debugging this broken program almost exhausted me, haha)
As you can see from the previous description, to use RS technology, the client and server need to meet the following two conditions:
1. The client only needs to support Java applet
2. The server only needs to support ASP
In other words, RS technology is completely independent of the browser (of course the browser needs to at least support Java
and JavaScript). You can use it in IE, too. It can be completely used in
NC, which is also a significant feature that distinguishes it from RDS technology.
Before being able to use RS technology flexibly, we must first explain an issue, which is the issue of "asynchronous call"
that was mentioned before. It is precisely because of the asynchronous call that you can only refresh a certain part of the page without refreshing
the entire page.
Due to this feature, you can let the server
check the validity of the data you input while you are browsing the page (of course this can be a series of very complex legality checks, for example,
Compare the data entered by the user with the existing data in the database, etc. This cannot be solved by the client's JS)
Then when the server returns the check result, you can perform the corresponding operation (such as popping up a The dialog box tells the user
Input errors, etc.)
The syntax for asynchronous calls is as follows:
RSExecute(serverURL, functionname, param_list)
The first parameter is the complete asp page you want to call URL path
The second parameter is the name of the function you want to call
The following are the input parameters required by the function
If the function you want to call requires two input parameters, it is written like this:
RSExecute(serverURL, functionname, f_arg_1, f_arg_2)
There are two ways to write when calling,
One is to return a result:
objResult = RSExecute(serverURL, functionname, f_arg_1 , f_arg_2);
The other is a calling method that does not return a result:
RSExecute(url, func_name, f_arg_1, f_arg_2, CallbackFunction);
Special attention should be paid to this calling method. It is a JS function on the client
. It means that once RS completes the call on the server, it will call this function immediately and return the result to this
function.
A typical CallbackFunction function should have the following structure:
function CallbackFunction(objResult) {
//Your own processing
}
The only input parameter objResult is called by RS Return value.
Let’s assume a situation like this:
The user enters the user’s e-mail address in the browser, and then the user leaves the e-mail address input box
and enters the next input process , this time it is time for RS to come into play. It queries the address in the database of the
server based on the address entered by the user, and then determines whether the user already exists, and then
returns the result to the client. The client then uses DHTML technology to prompt the user for the information previously entered in an input box called "ShowResult"
.
function CallbackFunc(objResult) {
// Prompt user information
window[objResult.context].value = objResult.return_value;
}
And RSExecute() should be called like this
RSExecute(serverURL, functionname, f_arg_1, CallbackFunc, "ShowResult");
No more, no more, the above is so long-winded, I think everyone is confused, so the following is
Let the specific code speak for itself:
(Please create a system DSN file called NW on your server before using the code. This file uses
Northworld, the sample database that comes with Chinese ACCESS97)
The following example works like this. default.htm is divided into two frames. RS technology is used in the
main.html page. You can notice that submit
is not used in main.html. So if If you hit the Enter key directly on this page, nothing will appear. You must click the
"Get Information" button with the mouse to use this partial page refresh technology. After clicking the button, there will be
a small delay on the page (during this time the java applet establishes a connection with the server in the background)
Then the page will return to the normal mouse immediately, and you can continue to perform other operations on the page.
Instead of having to wait for data like when a normal page is refreshed.
Everyone can understand info.asp at a glance. It is actually a very simple program for processing strings.
If you are familiar with DHTML technology, you can complete these operations on the client.
As for EmpData.asp, it is the program for processing data on the server side.
Well, you can experience the benefits yourself
.
Be especially careful not to change too much code, otherwise it is easy to make mistakes. After all, you are programming in JavaScript.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to design the dotted line segmentation effect in the menu? When designing menus, it is usually not difficult to align left and right between the dish name and price, but how about the dotted line or point in the middle...

HTML Element Analysis in Web Code Editor Many online code editors allow users to enter HTML, CSS, and JavaScript code. Recently, someone proposed...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.