Client code mouseover.php
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> Mouse Suspension Test </title>
<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>
Server-side code:
mouseover_check.php
Copy Code code as follows:
<?php
Header ("content-type:text/html;charset=gb2312");
Header ("Cache-control:no-cache,must-revalidate");
$name = $_get[' page '];
if ($name = = ' 1 ') {
echo "111";
}
else{
echo "222";
}
?>