代码如下
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form action="login.php" method="POST">
<input type="text" name="name" id="name">
<input type="submit" name="" id="submit" value="提交">
</form>
<script type="text/javascript">
$("#submit").on("click",function(){
$.ajax({
type: "post",
url:"login1.php"
dataType: "json",
data: $("#signupForm").serialize(),
success: function (msg) {
alert(msg);
}
});
})
</script>
</body>
</html>
当我使用ajax提交表单的时候 提交的地址是取决于from的action参数还是ajax的url参数? 还有提交方式是取决于form的method参数还是ajax的type参数?