关于chrome浏览器中实现ajax下拉框二级联动
lc12d 2018-06-06 11:36:20 网页上有2个下拉框,第一个下拉框选择后使用ajax查询数据库赋值给第二个下拉框,现在在IE下都没有问题, 在chrome下显示Uncaught TypeError: Object #<XMLHttpRequest> has no method 'Send'
ajax代码如下
var xmlhttp;
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
}
function fanhuisize(obj,sizedownlist)
{
var kw= encodeURIComponent(obj.value);
createXMLHttpRequest();
xmlhttp.open("GET","searchsize.aspx?kw=" + kw,true);
xmlhttp.onreadystatechange =function(){stateChange(obj,sizedownlist);};
xmlhttp.Send(ArrayBufferView); 总是提示这里有错误,没有send这个方法
}
function stateChange(obj,sizedownlist)
{
if(xmlhttp.readystate==4)
{
if(xmlhttp.status==200)
{
if(xmlhttp.ResponseText!="")
{
// alert(xmlhttp.ResponseText);
var strs= new Array(); //定义一数组
strs=xmlhttp.ResponseText.split(","); //字符分割
var option = null;
var first = document.getElementById(sizedownlist);
document.getElementById(sizedownlist).options.length =1;
for ( var i=0;i<strs.length-1;i++ )
{
option = document.createElement("option");
option.appendChild(document.createTextNode(strs[i]));
option.vaule = strs[i];
first.appendChild(option);
}
}
}
}
}
在chrome浏览器中显示没有send的方法,在chrome浏览器中该如何实现这样的二级联动呢,请求大神帮忙
谢谢