ajax的post请求方式,ajax的post请求方式

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

This is my JSP page

div{

border: 1px solid red;

width: 400px;

height: 300px;

}

function testAjax(){

//document.getElementById("msg").innerHTML = "加载中...";

//id;

var request;

//创建 request对象

if(window.XMLHttpRequest){//兼容性

request = new XMLHttpRequest();

}else if(window.ActiveXObject){//针对IE

request = new ActiveXObject("Msxml2.XMLHTTP");

}

//写监听 去check request的状态

request.onreadystatechange = function(){

//

//console.log(request.readyState);

if(request.readyState == 4){

你可能感兴趣的:(ajax的post请求方式)