关于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浏览器中该如何实现这样的二级联动呢,请求大神帮忙

谢谢
...全文
237 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ambit_tsai-微信 2018-06-06
  • 打赏
  • 举报
回复
xmlhttp.Send大小写错了?还是你发错了?
lc12d 2018-06-06
  • 打赏
  • 举报
回复
呀呀呀,感谢,大小写错了,郁闷

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧