为啥在FF 没反应?
<!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></title>
<script type="text/javascript" src="skin/jquery.js"></script>
<script type="text/javascript">
function p()
{
var postUrl = "http://localhost:3168/WebForm3.aspx";
var name = $("#name").val();
var sex = $("#sex").val();
$.post(postUrl,{
name:name,
sex:sex
},function (data,textStatus){
$("#result").html(data);
});
}
</script>
</head>
<body>
<input type="text" value="" id="name"/>
<input type="text" value="" id="sex" />
<input type="button" value="提交" onclick="p()"/><div id="result">
</div>
</body>
</html>
后台ASPX 代码
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;namespace WebApplication1
{
public partial class WebForm3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ if (Request.HttpMethod == "POST")
{
Response.Clear();
Response.Write("姓名是:" + Request.Form["name"] +"_____"+ " 性别:" + Request.Form["sex"] + "");
Response.End();
}
}
}
}
<!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></title>
<script type="text/javascript" src="skin/jquery.js"></script>
<script type="text/javascript">
function p()
{
var postUrl = "http://localhost:3168/WebForm3.aspx";
var name = $("#name").val();
var sex = $("#sex").val();
$.post(postUrl,{
name:name,
sex:sex
},function (data,textStatus){
$("#result").html(data);
});
}
</script>
</head>
<body>
<input type="text" value="" id="name"/>
<input type="text" value="" id="sex" />
<input type="button" value="提交" onclick="p()"/><div id="result">
</div>
</body>
</html>
后台ASPX 代码
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;namespace WebApplication1
{
public partial class WebForm3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ if (Request.HttpMethod == "POST")
{
Response.Clear();
Response.Write("姓名是:" + Request.Form["name"] +"_____"+ " 性别:" + Request.Form["sex"] + "");
Response.End();
}
}
}
}
name:escape(name),
sex:escape(sex)
},function (data,textStatus){
$("#result").html(data);
});