jquery引入有问题?ajax未定义?
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Document</title></head><body><h1>员工查询</h1><label for="keyword">请输入员工编号:</label><input type="text" id="keyword"><button id="search">查询</button><p id="searchResult"></p><br><h1>员工创建</h1><label for="staffName">请输入员工姓名:</label><input type="text" id="staffName"><label for="staffNumber">请输入员工编号:</label><input type="text" id="staffNumber"><label for="staffSex">请输入员工性别:</label><input type="text" id="staffSex"><label for="staffjob">请输入员工职位:</label><input type="text" id="staffJob"><button id="save">保存</button><p id="createResult"></p><script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script><script>//jquery封装Ajax方法$(document).ready(function(){$("#search").click(function(){$ajax({type:"GET",url:"server.php?number"+$("#keyword").val(),dataType:"json",success:function(data){if(data.success){$("#searchResult").html(data.msg);}else{$("#searchResult").html("出现错误:"+data.msg);}},error:function(){alert("发生错误:"+jqXHR.status);}});});$("#save").click(function(){$ajax({type:"POST",url:"server.php",dataType:"json",data:{name:$("staffName").val(),number:$("staffNumber").val(),sex:$("staffSex").val(),job:$("staffJob").val(),},success:function(data){if(data.success){$("#createResult").html(data.msg);}else{$("#createResult").html("出现错误:"+data.msg);}},error:function(){alert("发生错误:"+jqXHR.status);}});});});</script></body></html>
ajax.html:31 Uncaught ReferenceError: $ajax is not defined
at HTMLButtonElement.<anonymous> (ajax.html:31)
at HTMLButtonElement.dispatch (jquery-3.3.1.min.js:2)
at HTMLButtonElement.y.handle (jquery-3.3.1.min.js:2)