ajax post 提交数据


< script language = " javascript " >  
xml 
=   new  ActiveXObject( " Microsoft.XMLHTTP " ); 
var  post = " name=456789post " ; // 构造要携带的数据 
xml.open( " POST " , " http://localhost/postdata/WebForm3.aspx " , false ); // 使用POST方法打开一个到服务器的连接,以异步方式通信 
xml.setrequestheader( " content-length " ,post.length); 
xml.setrequestheader(
" content-type " , " application/x-www-form-urlencoded " ); 
xml.send(post);
// 发送数据 
var  res  =  xml.responseText; // 接收服务器返回的数据 
document.write(res); 
script >

取职
    string name 
=  Request[ " name " ].ToString();
                Response.Clear();
                Response.Write(
" 789798 " + name);
                Response.End();

 escape()解决中文问题

你可能感兴趣的:(ajax post 提交数据)