<script language="javascript" type="text/javascript">
var infodiv;
var bigtype;
var smalltype;
function select()
{
bigtype=$("<%=ddlsearchbigtype.ClientID %>");
smalltype=$("<%=ddlsearchsmalltype.ClientID %>")
if(bigtype.selectedIndex!=0)
{
infodiv=$("info");
var url="/ajax/select.aspx";
var param="id="+bigtype.options[bigtype.selectedIndex].value;
var myAjax=new Ajax.Request(
url,
{
method: 'get',
parameters:param,
onCreate:onCreate,
onSuccess:onSuccess,
onFailure:onFailure,
onComplete:showResponse,
asynchronous:true
}
);
}
else
{
for(var i=1 ;i<smalltype.options.length;i++)
{
smalltype.options.remove(i);
}
}
}
function onCreate(request)
{
infodiv.show();
}
function onFailure(request)
{
alert(request.responesText);
}
function onSuccess(request)
{
infodiv.hide();
}
function showResponse(request)
{
var txt=request.responseText; //获取select.aspx的页面的值
var array=txt.split("@");
smalltype=$("<%=ddlsearchsmalltype.ClientID %>");
var h=document.getElementById('hidden'); alert(h);
h.value="";
smalltype.options.length=0;
smalltype.options.add(new Option('子类类别','0'));
for(var i=1;i<array.lenght;i++)
{
var id=array[i].split("#")[0];
var name=array[i].split("#")[1];
var op=new Option(name,id);
alert(op);
smalltype.options[smalltype.options.length] = op;
alert(smalltype.options[smalltype.options.length]);
h.value+="#"+id;
}
}
function select_1()
{
var h=document.getElementById('hidden');
alert(h);
var array=h.value.split('#')
var h_1=document.getElementById('hidden_1')
h_1.value='';
h_1.value=array[smalltype.selectedIndex];
}
function bigtype1(source,args)
{
var bigtype= $("<%=ddlsearchbigtype.ClientID %>");
document.getElementById("<%=hid2.ClientID%>").value=bigtype.value;
args.IsValid = bigtype.selectedIndex == 0 ? false : true;
}
function smalltype2(source,args)
{
var small = $("<%=ddlsearchsmalltype.ClientID %>");
args.IsValid = small.selectedIndex == 0 ? false : true;
}
</script>
我引用了“prototype.js”,红色语句不知道什么问题?我在2005vs工程下面调试时弹出"object HTMLInputEelment",但在2008vs工程引用进来 “prototype.js”,红色地方“NULL”为空.
var infodiv;
var bigtype;
var smalltype;
function select()
{
bigtype=$("<%=ddlsearchbigtype.ClientID %>");
smalltype=$("<%=ddlsearchsmalltype.ClientID %>")
if(bigtype.selectedIndex!=0)
{
infodiv=$("info");
var url="/ajax/select.aspx";
var param="id="+bigtype.options[bigtype.selectedIndex].value;
var myAjax=new Ajax.Request(
url,
{
method: 'get',
parameters:param,
onCreate:onCreate,
onSuccess:onSuccess,
onFailure:onFailure,
onComplete:showResponse,
asynchronous:true
}
);
}
else
{
for(var i=1 ;i<smalltype.options.length;i++)
{
smalltype.options.remove(i);
}
}
}
function onCreate(request)
{
infodiv.show();
}
function onFailure(request)
{
alert(request.responesText);
}
function onSuccess(request)
{
infodiv.hide();
}
function showResponse(request)
{
var txt=request.responseText; //获取select.aspx的页面的值
var array=txt.split("@");
smalltype=$("<%=ddlsearchsmalltype.ClientID %>");
var h=document.getElementById('hidden'); alert(h);
h.value="";
smalltype.options.length=0;
smalltype.options.add(new Option('子类类别','0'));
for(var i=1;i<array.lenght;i++)
{
var id=array[i].split("#")[0];
var name=array[i].split("#")[1];
var op=new Option(name,id);
alert(op);
smalltype.options[smalltype.options.length] = op;
alert(smalltype.options[smalltype.options.length]);
h.value+="#"+id;
}
}
function select_1()
{
var h=document.getElementById('hidden');
alert(h);
var array=h.value.split('#')
var h_1=document.getElementById('hidden_1')
h_1.value='';
h_1.value=array[smalltype.selectedIndex];
}
function bigtype1(source,args)
{
var bigtype= $("<%=ddlsearchbigtype.ClientID %>");
document.getElementById("<%=hid2.ClientID%>").value=bigtype.value;
args.IsValid = bigtype.selectedIndex == 0 ? false : true;
}
function smalltype2(source,args)
{
var small = $("<%=ddlsearchsmalltype.ClientID %>");
args.IsValid = small.selectedIndex == 0 ? false : true;
}
</script>
我引用了“prototype.js”,红色语句不知道什么问题?我在2005vs工程下面调试时弹出"object HTMLInputEelment",但在2008vs工程引用进来 “prototype.js”,红色地方“NULL”为空.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货