先看段代码吧:
window.onload = function() {
var sel_brand = document.getElementById("sel_brand");
sel_brand.onchange = function() {
var xmlHttpRequest = null;
var xmlHttpRequest1=null;
if (XMLHttpRequest ) {
xmlHttpRequest = new XMLHttpRequest();
} else {
xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlHttpRequest.open("post", "finTypeBrandId.do?bid="+this.value, true);
xmlHttpRequest.onreadystatechange = function() {
if (xmlHttpRequest.readyState == 4) {
var obj = xmlHttpRequest.responseText;
obj = eval("(" + obj + ")");
var b_type = document.getElementById("b_type");
b_type.innerHTML = "";
for ( var c in obj) {
var op = document.createElement("option");
op.innerHTML = obj[c].name;
op.value = obj[c].id;
b_type.appendChild(op);
}
}
}
xmlHttpRequest.send(null);
}
}
需要添加另外一个事件,提交的数据还是这个数据,方法为另外一个,一个请求调用两个方法
怎么处理?是创建ajax的池吗