js| Case | rmb | page | conversion
Implementation method One
Applet Implementation page is rmb.jsp, this page is through the applet to achieve the RMB lowercase conversion to uppercase. This page has three variables that need to be initialized when classes is loaded:
<applet type= "applet" id= "myapplet" codebase = "" Name= "Testapplet"
Align= "Middle" code= "Lqh.rmb.Applicate.Rmb.class"
Width= "560" height= ">"
<param name= "Rgb_back" value= "241|247|251" >
<param name= "Rgb_fore" value= "255|0|0"/>
<param name= "Wigth" value= "560"/>
</applet>
Variable rgb_back is to initialize the background color, modify the secondary variable can make the background color of the applet and its own page style; variable rgb_fore is the color of the initialization font; Wigth to the width of the applet, this variable is guaranteed to display the conversion information in the middle.
This method cannot pass a value to the page trans.jsp and can only be displayed and cannot be copy.
The page code is as follows:
<%@ page contenttype= "text/html;charset=gb2312"%>
<script language=javascript>
function trans () {
Take the value of a variable
var aaa=document.rmb. Rmb_test.value;
Assign a variable to the applet value
Document.myApplet.setRMB (AAA);
Document.myApplet.repaint ();
return true;
}
</SCRIPT>
<body>
<form name= "RMB" >
Enter Amount: <input type= "text" name= "Rmb_test" onkeyup= "Trans ()" ><br>
<%@ include file= ". /rmb.jsp "%>
</form>
</body>
Implementation Method Two
Applet Implementation page is rmb.jsp, this page is through the applet to achieve the RMB lowercase conversion to uppercase. This page does not require a variable initialization, the image that the applet paints is not displayed on the page, and the converted value can be passed to the page variable:
<applet type= "applet" id= "myapplet" codebase = "" Name= "Testapplet"
Align= "Middle" code= "Lqh.rmb.Applicate.Rmb.class"
Width= "0" height= "0" >
</applet>
The page trans.jsp code is as follows:
<%@ page contenttype= "text/html;charset=gb2312"%>
<%@ include file= ". /rmb.jsp "%>
<script language=javascript>
function trans () {
var aaa=document.rmb. Rmb_test.value;
Get the converted Value
var RMB = Document.myApplet.getRMB (AAA);
DOCUMENT.RMB. Rmb_result.value = RMB;
return true;
}
</SCRIPT>
<body>
<form name= "RMB" >
Enter Amount: <input type= "text" name= "Rmb_test" onkeyup= "Trans ()" ><br>
Convert result: <input type= "text" name= "Rmb_result" ><br>
</form>
</body>