<!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 runat="server">
<title>无标题页</title>
<script language="javascript" src="../jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(function(){
$("#TextBox1").keydown(function(e){
if(e.keyCode==13){
var f=$("<form method= 'post ' action= 'Default.aspx ' ></form>");
var i= $("<input type= 'text ' name= 'username' value='ASXJHNASJXASJ阿贾克斯' /> ");
f.append(i);
$("body").append(f);
f.submit();
}
})
})
</script>
</head>
<body>
<input id="TextBox1" type="text" />
</body>
</html>
为什么按下回车,浏览器里变成是GET提交了,明明写着是POST
JQUERY 提交post变GET
答案:2 悬赏:30 手机版
解决时间 2021-03-20 17:10
- 提问者网友:蔚蓝的太阳
- 2021-03-20 08:57
最佳答案
- 五星知识达人网友:孤独的牧羊人
- 2021-03-20 09:47
method= 'post '
post后面多了一个空格
应该是method='post'
post后面多了一个空格
应该是method='post'
全部回答
- 1楼网友:你可爱的野爹
- 2021-03-20 10:33
$.post("file.php",<br>{<br>title:"up",<br>name:"a",<br>pwd:"b"<br>},<br>function(data, status) {<br>alert(data);<br>});
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯