Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>
<body>
<style type= "Text/css" >
<!--
Body {
Background-color: #FFFFFF;
font-size:85%;
Font-family:verdana;
margin-top:10px;
margin-left:10px;
}
A:link{color: #3737c8}
a:active {color: #f00;}
a:visited {color: #639;}
-->
</style>
<script language= "JavaScript" >
var http_request = false;
function send_request (URL) {//initialization, specifying handler functions, sending requests
Http_request = false;
Start initializing the XMLHttpRequest object
if (window. XMLHttpRequest) {//mozilla browser
Http_request = new XMLHttpRequest ();
if (http_request.overridemimetype) {//Set MIME category
Http_request.overridemimetype (' Text/xml ');
}
}
else if (window. ActiveXObject) {//IE browser
try {
Http_request = new ActiveXObject ("Msxml2.xmlhttp");
catch (e) {
try {
Http_request = new ActiveXObject ("Microsoft.XMLHTTP");
catch (e) {}
}
}
if (!http_request) {//exception, failed to create object instance
Window.alert ("Cannot create XMLHttpRequest object instance.");
return false;
}
Http_request.onreadystatechange = ProcessRequest;
Determine how and when the request is sent and whether the next code is executed synchronously
Http_request.open ("Get", url, True);
Http_request.send (NULL);
}
Functions that process return information
function ProcessRequest () {
if (http_request.readystate = = 4) {//Judge object state
if (Http_request.status = = 200) {//information has been successfully returned to start processing information
alert (Http_request.responsetext);
document.getElementById ("Result"). InnerHTML = Http_request.responsetext;
} else {//page is not normal
Alert ("The page you are requesting has an exception.) ");
}
}
}
function Dosearch () {
var f = document.form1;
var geci = F.geci.value;
if (geci== "") {
Window.alert ("Please enter the lyrics you want to query");
F.geci.focus ();
return false;
}
else {
document.getElementById ("Result"). Innerhtml= "Being queried, please wait";
Send_request (' http://www.efish.cn/getgeci.aspx?m= ' +escape (GECI));
}
}
function SubmitForm () {
if (window.event.keycode==13) {
Dosearch ();
}
}
</script>
<p></p><p></p>
<form id= "Form1" Name= "Form1" method= "Post" action= "" >
<center><span style= "FONT-SIZE:18PX; Color: #FF0000 "> 100,000 lyrics online free enquiry </span></center>
<p></p>
Please enter a song name:
<input name= "Geci" type= "text" id= "Geci" value= "Dongfeng Broken" size= "" height= "" maxlength= "" "onkeydown=" SubmitForm "/ >
<input type= "button" name= "search" value= "Query lyrics" onclick= "Dosearch ()" ><br
<span id= "Result" ></span>
</form>
</body>