function DownloadStart(ids, self) {
var waitMsg = $('#idDownloadWait');
var jqSelf = $(self);
waitMsg.show();
jqSelf.hide();
var getjosn_url = "GetSongUrlAndName.php";
var thunder_pid = "50344";
$.getJSON(getjosn_url, { id: ids, temp: Math.random() }, function (jsonData) {
if (jsonData == null) {
alert('下载失败!');
waitMsg.hide(); jqSelf.show();
return;
}
if (jsonData.State == 1) {
thunderBatchTask(jsonData, thunder_pid);
//window.close();
}
else {
alert(jsonData.Msg);
waitMsg.hide(); jqSelf.show();
}
});
GetSongUrlAndName.php没数据的时候是这样
{"UrlList":[],"State":0,"Msg":"参数错误!"}有数据时候的结构是什么?
怎么下载文件啊?
看不懂json
var waitMsg = $('#idDownloadWait');
var jqSelf = $(self);
waitMsg.show();
jqSelf.hide();
var getjosn_url = "GetSongUrlAndName.php";
var thunder_pid = "50344";
$.getJSON(getjosn_url, { id: ids, temp: Math.random() }, function (jsonData) {
if (jsonData == null) {
alert('下载失败!');
waitMsg.hide(); jqSelf.show();
return;
}
if (jsonData.State == 1) {
thunderBatchTask(jsonData, thunder_pid);
//window.close();
}
else {
alert(jsonData.Msg);
waitMsg.hide(); jqSelf.show();
}
});
GetSongUrlAndName.php没数据的时候是这样
{"UrlList":[],"State":0,"Msg":"参数错误!"}有数据时候的结构是什么?
怎么下载文件啊?
看不懂json
json数据是可以转换为数组的!你可以去查下:JSON.parse() 与 eval() 函数