在html页面中执行ajax,但是ajax无法执行?具体代码如下:
<scripttype="text/javascript">functionformSubmit(){if(document.getElementById("userCD...
<script type= "text/javascript">
function formSubmit(){
if (document.getElementById("userCD").value==""){
alert("请输入用户名!");
return;
}
if (document.getElementById("userPassword").value==""){
alert("请输入密码!");
return;
}
var codeSQM1='userCD='+document.getElementById("userCD").value+'&userPassword='+document.getElementById("userPassword").value;
var strurl ='/ice_erp_manage/login/loginAction!getLogin.html';
$.ajax({
type:"post",
url:strurl,// action地址
data:codeSQM1,
dataType:"json",
success:function(cflag){
}
});
}
</script> 展开
function formSubmit(){
if (document.getElementById("userCD").value==""){
alert("请输入用户名!");
return;
}
if (document.getElementById("userPassword").value==""){
alert("请输入密码!");
return;
}
var codeSQM1='userCD='+document.getElementById("userCD").value+'&userPassword='+document.getElementById("userPassword").value;
var strurl ='/ice_erp_manage/login/loginAction!getLogin.html';
$.ajax({
type:"post",
url:strurl,// action地址
data:codeSQM1,
dataType:"json",
success:function(cflag){
}
});
}
</script> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询