<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<Script type = "text/javascript">
Var xmlHttp = false;
Try {
XmlHttp = new XMLHttpRequest ();
} Catch (e ){
Try {
XmlHttp = new ActiveXObject ("Msxml2.XMLHTTP ");
} Catch (e2 ){
Try {
XmlHttp = new ActiveXObject ("Microsoft. XMLHTTP ");
} Catch (e3 ){
XmlHttp = false;
}
}
}
Function call ()
{
Var hanzi = document. getElementById ("hanzi"). value;
If (hanzi = null | hanzi = "")
Return;
Var url = "pingyin. php? Hanzi = "+ hanzi;
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = chang_to_pingyin1;
XmlHttp. send ();
}
Function chang_to_pingyin1 ()
{
If (xmlHttp. readystate = 4)
{
If (xmlHttp. status = 200)
{
Var pingyin1 = xmlHttp. responseText;
Document. getElementById ("1"). value = pingyin1;
}
Else
Alert ("The status is" + xmlHttp. status );
}
}
Function call2 ()
{
Var hanzi = document. getElementById ("hanzi2"). value;
If (hanzi = null | hanzi = "")
Return;
Var url = "pingyin. php? Hanzi = "+ hanzi;
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = chang_to_pingyin2;
XmlHttp. send ();
}
Function chang_to_pingyin2 ()
{
If (xmlHttp. readystate = 4)
{
If (xmlHttp. status = 200)
{
Var pingyin2 = xmlHttp. responseText;
Document. getElementById ("2"). value = pingyin2;
}
Else
Alert ("The status is" + xmlHttp. status );
}
}
Function call3 ()
{
Var hanzi = document. getElementById ("hanzi3"). value;
If (hanzi = null | hanzi = "")
Return;
Var url = "pingyin. php? Hanzi = "+ hanzi;
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = chang_to_pingyin3;
XmlHttp. send ();
}
Function chang_to_pingyin3 ()
{
If (xmlHttp. readystate = 4)
{
If (xmlHttp. status = 200)
{
Var pingyin3 = xmlHttp. responseText;
Document. getElementById ("3"). value = pingyin3;
}
Else
Alert ("The status is" + xmlHttp. status );
}
}
Function call4 ()
{
Var hanzi = document. getElementById ("hanzi4"). value;
If (hanzi = null | hanzi = "")
Return;
Var url = "pingyin. php? Hanzi = "+ hanzi;
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = chang_to_pingyin4;
XmlHttp. send ();
}
Function chang_to_pingyin4 ()
{
If (xmlHttp. readystate = 4)
{
If (xmlHttp. status = 200)
{
Var pingyin4 = xmlHttp. responseText;
Document. getElementById ("4"). value = pingyin4;
}
Else
Alert ("The status is" + xmlHttp. status );
}
}
</Script>
</Head>
<Body>
Input Chinese characters:
<Input name = "hanzi" type = "text" id = "hanzi" onKeyup = "return call ();"/>
<Input name = "hanzi2" type = "text" id = "hanzi2" onKeyup = "return call2 ();"/>
<Input name = "hanzi3" type = "text" id = "hanzi3" onKeyup = "return call3 ();"/>
<Input name = "hanzi4" type = "text" id = "hanzi4" onKeyup = "return call4 ();"/>
<Br/>
<Input name = "1" type = "hidden" id = "1" onpropertychange = "javascript: document. getElementById ('pingyins '). value = document. getElementById ('1 '). value + document. getElementById ('2 '). value + document. getElementById ('3 '). value + document. getElementById ('4 '). value; "/>
<Input name = "2" type = "hidden" id = "2" onpropertychange = "javascript: document. getElementById ('pingyins '). value = document. getElementById ('1 '). value + document. getElementById ('2 '). value + document. getElementById ('3 '). value + document. getElementById ('4 '). value; "/>
<Input name = "3" type = "hidden" id = "3" onpropertychange = "javascript: document. getElementById ('pingyins '). value = document. getElementById ('1 '). value + document. getElementById ('2 '). value + document. getElementById ('3 '). value + document. getElementById ('4 '). value; "/>
<Input name = "4" type = "hidden" id = "4" onpropertychange = "javascript: document. getElementById ('pingyins '). value = document. getElementById ('1 '). value + document. getElementById ('2 '). value + document. getElementById ('3 '). value + document. getElementById ('4 '). value; "/> <br/>
Pinyin note:
<Input name = "pingyins" type = "text" id = "pingyins"/>
</Body>
</Html>