为了账号安全,请及时绑定邮箱和手机立即绑定

点击查询按钮没有反应,一切按老师步骤来的

<!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=utf-8" />

<title>Demo</title>

<style>

*{

font-size:16px;

line-height:1.8;

}

</style>

</head>


<body>

<h1>员工查询</h1>

<label>请输入员工编号:</label>

<input type="text" id="keyword">

<button id="search">查询</button>

<p id="searchResult"></p>

<h1>员工创建</h1>

<label>请创建员工姓名:</label>

<input type="text" id="stuffName"></br>

<label>请创建员工编号:</label>

<input type="text" id="stuffNumber"></br>

<label>请选择员工性别:</label>

<select id="stuffSex"></br>

<option>男</option>

<option>女</option>

</select></br>

<label>请输入员工职位:</label>

<input type="text" id="stuffJob"></br>

<button id="save">保存</button>

<p id="createResult"></p>

<script>

document.getElementById("search").onclick=function(){

//发送ajax查询请求并处理

var request=new XMLHttpRequest();

request.open("GET","service.php?number="+document.getElementById("keyword").value);

request.send();

}

</script>

</body>

</html>


正在回答

2 回答

我是说在后端操作平台没有相关数据显示


0 回复 有任何疑惑可以回复我~

这个例子用firebug才能看到效果,页面上是不会有变化的

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Ajax全接触
  • 参与学习       224758    人
  • 解答问题       708    个

本课程通过一个案例,讲解Ajax的相关概念原理实现方式和应用

进入课程

点击查询按钮没有反应,一切按老师步骤来的

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号