使用XMLHttpRequest 实现移动鼠标出现不同的登录界面
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>鼠标移动</title> <script> var xmlHttp; function over(){ xmlHttp=new XMLHttpRequest(); xmlHttp.open("GET","test2.jsp",true); xmlHttp.send(null); xmlHttp.onreadystatechange=stateChanged; } function over1(){ xmlHttp=new XMLHttpRequest(); xmlHttp.open("GET","test6.jsp",true); xmlHttp.send(null); xmlHttp.onreadystatechange=stateChanged; } function stateChanged(){ if(xmlHttp.readyState==4){ document.getElementById("id2").innerHTML =xmlHttp.responseText; } } </script> </head> <body> <table border="1"> <tr><td> <h1 onmouseover="over()">用户登录</h1> </td><td> <h1 onmouseover="over1()">管理员登录</h1> </td> </tr> <tr><td colspan="2"> <div id="id2"> 用户名:<input type="text" size="20"/> <br> 密码: <input type="password" size="21"/> </div> </td></tr> </table> </body> </html>
相关推荐
81530694 2011-09-27
liqing00 2012-07-11
zergxixi 2016-10-31
jiaguoquan00 2020-07-07
zhaolisha 2020-06-12
坚持着执着 2020-06-05
knightwatch 2020-04-25
zhaolisha 2020-01-11
zhaolisha 2019-12-29
wanghongsha 2019-12-06
小小大人物 2014-01-19
loopstang 2014-01-11
roodyszz0 2019-11-17
81493369 2019-11-04
Liuzhiqianblog 2019-11-03
用不完的好奇心 2019-10-26
89241846 2019-09-12