如题,可能又是某个代码不支持造成的!希望高手改正:
代码如下,问题可能就在“function get_city_Result_CallBack(response)”这个函数里
<script language="javascript" type="text/javascript">
//城市------------------------------
function cityResult()
{
var city=document.getElementById("DropDownList1");
AjaxMethod.GetCityList(city.value,get_city_Result_CallBack);
}
function get_city_Result_CallBack(response)
{
if (response.value != null)
{
//debugger;
document.all("DropDownList2").length=0;
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null)
{
for(var i=0; i<ds.Tables[0].Rows.length; i++)
{
var name=ds.Tables[0].Rows[i].shiName;
var id=ds.Tables[0].Rows[i].shiID;
document.all("DropDownList2").options.add(new Option(name,id));
}
}
}
else
{
document.all("DropDownList2").length=0;
}
return
}
function getdata()
{
var classID=document.getElementById("DropDownList3");
var classindex=classID.selectedIndex;
var classValue=classID.options[classindex].value;
var classText=classID.options[classindex].text;
var province=document.getElementById("DropDownList1");
var pindex = province.selectedIndex;
var pValue = province.options[pindex].value;
var pText = province.options[pindex].text;
var city=document.getElementById("DropDownList2");
var cindex = city.selectedIndex;
var cValue = city.options[cindex].value;
var cText = city.options[cindex].text;
window.location.href="showinfo.aspx?classID="+classValue+"&shengID="+pValue+"&shiID="+cValue;
}
</script>
代码如下,问题可能就在“function get_city_Result_CallBack(response)”这个函数里
<script language="javascript" type="text/javascript">
//城市------------------------------
function cityResult()
{
var city=document.getElementById("DropDownList1");
AjaxMethod.GetCityList(city.value,get_city_Result_CallBack);
}
function get_city_Result_CallBack(response)
{
if (response.value != null)
{
//debugger;
document.all("DropDownList2").length=0;
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null)
{
for(var i=0; i<ds.Tables[0].Rows.length; i++)
{
var name=ds.Tables[0].Rows[i].shiName;
var id=ds.Tables[0].Rows[i].shiID;
document.all("DropDownList2").options.add(new Option(name,id));
}
}
}
else
{
document.all("DropDownList2").length=0;
}
return
}
function getdata()
{
var classID=document.getElementById("DropDownList3");
var classindex=classID.selectedIndex;
var classValue=classID.options[classindex].value;
var classText=classID.options[classindex].text;
var province=document.getElementById("DropDownList1");
var pindex = province.selectedIndex;
var pValue = province.options[pindex].value;
var pText = province.options[pindex].text;
var city=document.getElementById("DropDownList2");
var cindex = city.selectedIndex;
var cValue = city.options[cindex].value;
var cText = city.options[cindex].text;
window.location.href="showinfo.aspx?classID="+classValue+"&shengID="+pValue+"&shiID="+cValue;
}
</script>
getElementsByTagName("*") 可以得到得到所有元素的集合
getElementById 可以按id得到某一元素
getElementsByName 可以得到按name属性得到某一元素
都不行
=>
document.getElementById有一部分 你还没有替换
不过还有个问题请教,在google浏览器里执行时出现完全不对应的情况,这又是为什么呢?
真是麻烦啊!