@
lslqtz 我表示 js 渣。。
相关
function get_downloadurl(id, z_index) {
var downloadList = new Array();
for(var i in netCheck) {
if(!isUndef(z_index)) {
var ary = batch_down_bt_info['Result'][id][z_index]['cdn'];
for(var j in ary) {
if (i == j) {
downloadList.push(i);
}
}
} else {
var obj_bt = _$('bt_list'+id+"_"+i);
var obj = _$('dl_url'+id+"_"+i);
if (obj || obj_bt) {
downloadList.push(i);
}
}
}
var speed_max=0;
var default_p = getCookie('lixian_section_select');
var p='';
for(var i=0; i<downloadList.length; i++) {
var speed_now = get_speed(downloadList[i]);
var speed_now = parseInt(speed_now);
if(default_p!= '' && default_p==downloadList[i]) {
p = downloadList[i];
break;
}
if (!speed_now) {
continue;
}
if (speed_now>speed_max) {
speed_max=speed_now;
p = downloadList[i];
}
}
var obj_bt = _$('bt_list'+id);
var obj = _$('dl_url'+id);
if(p=='') {
if(!isUndef(z_index)) {
return batch_down_bt_info['Result'][id][z_index]['downurl'];
} else if(obj_bt) {
return _$('bt_list'+id).value;
} else {
return _$('dl_url'+id).value;
}
} else {
if(!isUndef(z_index)) {
return batch_down_bt_info['Result'][id][z_index]['cdn'][p];
} else if(obj_bt) {
return _$('bt_list'+id+"_"+p).value;
} else {
return _$('dl_url'+id+"_"+p).value;
}
}
}