日期:2014-05-16 浏览次数:20572 次
var br = new Array();
br[1] = new Array(); //身份信息
br[1][1] = "身份证明不清晰";
br[1][2] = "需补充二代身份证";
br[1][3] = "申请人有两个身份证号码(非正常升位),需补充派出所卡具的户籍证明";
br[1][4] = "身份证信息录入有误";
br[1][5] = "其他";
function htyy(obj){
//这里怎么获得br这个数组
var zhuyuanyin = $(obj).val();
var ziyuanyin_html = "";
var ziyuanyin_obj = br[zhuyuanyin];
$.each($(ziyuanyin_obj), function(i, n){
ziyuanyin_html += "<option value='"+i+"'>"+n+"</option>";
});
$("select[name='htyy_2']").html(ziyuanyin_html);
}
document.write ('<script src="a.js"></script>')
//注意使用a.js数组的代码要放到window.onload中,动态输出的script不会挂起本js文件后续代码的执行
window.onload=function(){
//your code use a.js array
}
<script>
var flag=false;
var loading = false;
var error = false;
var time = null;
function success(){
flag=true;
loading = 'over';
};
function error(){
error=true;
}
function getData(){
$.ajax({
url: 'arr.js',
dataType: "script",
success: success,
error : error
});
}
function htyy(obj){
if(!flag){
if(error){
alert('error');
return;
}
if(loading){
if(loading == 'over'){
clearInterval(time);
}
return;
}else{
loading = true;
getData();
time = setInterval(jQuery.proxy(htyy,null,obj),500);
return;
}
}else{
clearInterval(time);
}
var $a = br;
var $b = obj;
/*
var zhuyuanyin = $(obj).val();
var ziyuanyin_html = "";
var ziyuanyin_obj = br[zhuyuanyin];
$.each($(ziyuanyin_obj), function(i, n){
&nbs