admin_res.js
上传用户:szhf331
上传日期:2022-06-22
资源大小:1032k
文件大小:2k
- function deleteAllOptions(sel){sel.options.length=0;}
- function checkCols(){
- var strid = $("select")[1].options[$("select")[1].selectedIndex].value*1;
- if (strid==0){
- fillSel("请选择...",$("select")[2]);
- $("span")[0].innerHTML="";
- }else{
- postCols(strid);
- }
- }
- function postCols(Col_id){
- var xmlhttp;
- try{
- xmlhttp=new XMLHttpRequest();
- }
- catch(e){
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.onreadystatechange=function(){
- if (xmlhttp.readyState==4){
- if (xmlhttp.status==200){
- var data=xmlhttp.responseText;
- id_result(data);
- }
- else{
- fillSel("文件传输失败!",$("select")[2]);
- $("span")[0].innerHTML="<img src='../images/reg_yesno.gif' alt='文件传输失败!'>";
- }
- }
- else{
- fillSel("正在刷新...",$("select")[2]);
- $("span")[0].innerHTML="<img src='images/loading.gif' alt='正在刷新专业下拉列表......'>";
- }
- }
- var BaseURL="admin_res_check.asp"
- var url = BaseURL + "?timeStamp=" + new Date().getTime();
- xmlhttp.open("post", url, true);
- xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=gb2312');
- xmlhttp.send("Col_id="+escape(Col_id));
- }
- function id_result(data){
- var pronames
- var data_arr
- if(data!="0"){
- data = data.split('%%');
- $("select")[2].options.length=0;
- $("select")[2].options[0] = new Option("请选择...","0");
- for(data_i=0;data_i<data.length;data_i++){
- data_arr=data[data_i];
- data_arr=data_arr.split('||');
- $("select")[2].options[data_i+1] = new Option(data_arr[1],data_arr[0]);
- }
- $("select")[2].selectedIndex = data_i;
- setSel2(0,$("select")[2])
- $("span")[0].innerHTML="<img src='../images/reg_yesok.gif' alt='专业下拉列表更新成功!'>";
- checkcourses();
- }else{
- fillSel("当前还没有专业",$("select")[2]);
- $("span")[0].innerHTML="<img src='../images/reg_yesno.gif' alt='专业下拉列表为空,请添加专业!'>";
- }
- }
- //$div
- //formToRequestString
- //ajaxLoadPage
- //ajaxFormSubmit
- function change(v){
- var nowvalue=$sel(s[v*1-1]).value*1;
- if (nowvalue>0){
- postinfos(s[v-1]+"="+nowvalue,"admin_res_check.asp",s[v-1],s[v]);
- }else{
- for(i=v;i<s.length;i++){
- fillSel("请选择...",$val(s[i]));
- $div(s[i]).innerHTML="";
- }
- }
- }