Remote Scripting Advanced Tutorial---Make remote scripting available on the customer page
Source: Internet
Author: User
Make Remote scripting available on customer pages
Before you can use remote scripting to invoke server scripts, you must add the remote scripting capability to the user's customer page. The routines required to use the remote scripting from the client script are included in the rs.htm file. The user must include the file in their own customer page. In addition, the user must invoke a method to start the remote Scripting applet.
In order to make the remote scripting effective,
Create an empty JavaScript script block--it references the rs.htm file, as shown in the following example:
<script language= "JavaScript" src= ". /_scriptlibrary/rs.htm ">
To ensure that the path to the specified rs.htm file is correct. The script block can appear anywhere on the user's customer page, but must be in one such block--it executes before the user invokes a remote procedure.
Creates a second JavaScript script block, and calls method Rsenableremotescripting in this block. By default, the method assumes that the Rsproxy.class applet is in a folder called _ScriptLibrary, and that it happens to be in the subordinate directory of the user server or the virtual root of the project. If this is not the case, then you must pass the path to the Rsproxy.class file in the method call.
This script block that contains rsenableremotescripting must appear in the main part of the document because it creates <APPLET> tags that contain references to Rsproxy.class. It must be placed after the script block that includes the rs.htm file. You can also put it behind the <BODY> tag, as shown in the following example:
<BODY>
<script language= "JavaScript" >
Rsenableremotescripting (".. /_scriptlibrary ")
</script>
<!--This is the rest of the. htm file-->
Note that the <APPLET> tag created by Rsenableremotescripting does not appear on your page-even if you view the page's source program in your own browser.
A sketch customer page with a valid remote scripting is like this:
<HTML>
< header >
< title >remote scripting Test </title >
</Header >
< subject >
<script language= "JavaScript" src= ". /_scriptlibrary/rs.htm "></script >
<script language= "JavaScript" >
Rsenableremotescripting (".. /_scriptlibrary ")
</Scripts >
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.