Client Code Mouseover. php
Copy code The Code is as follows: <! 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> mouse suspension test </title>
</Head>
<SCRIPT type = "text/JavaScript" Language = "JavaScript">
VaR XMLHTTP;
Function createxmlhttprequest (){
If (window. activexobject ){
XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
}
Else if (window. XMLHttpRequest ){
XMLHTTP = new XMLHttpRequest ();
}
}
Function sendrequest (t ){
VaR id = T. ID
Createxmlhttprequest ();
VaR url = "mouseover_check.php? Page = "+ T. ID;
XMLHTTP. onreadystatechange = callback;
XMLHTTP. Open ('get', URL, true );
XMLHTTP. Send (null );
}
Function callback (){
If (XMLHTTP. readystate = 4 ){
If (XMLHTTP. Status = 200 ){
Document. getelementbyid ("show"). innerhtml = XMLHTTP. responsetext;
}
}
}
</SCRIPT>
<Body>
<P>
<Input type = "text" value = "here" id = "1" onmouseover = "sendrequest (this)"/>
</P>
<P> <br/>
<Input type = "text" value = "Haha" id = "2" onmouseover = "sendrequest (this)"/>
</Div>
</P>
<P> </P>
<Span id = "show"> </span>
</Body>
</Html>
server code:
mouseover_check.php copy Code the code is as follows: header ("Content-Type: text/html; charset = gb2312");
header ("cache-control: No-cache, must-revalidate ");
$ name = $ _ Get ['page'];
if ($ name = '1 ') {
echo "111";
}< br> else {
echo "222";
}< BR >?>