-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvv51list.js
More file actions
75 lines (62 loc) · 1.84 KB
/
Copy pathvv51list.js
File metadata and controls
75 lines (62 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
function loadScript(url, callback) {
var script = document.createElement("script");
script.type ="text/javascript";
// IE
if (script.readyState) {
script.onreadystatechange = function () {
if (script.readyState =="loaded"|| script.readyState =="complete") {
script.onreadystatechange = null;
callback();
}
};
} else { // others
script.onload = function () {
callback();
};
}
script.src = url;
document.body.appendChild(script);
}
function getList(){
var list = new Array();
var host = window.location.protocol +"//"+ window.location.host;
if(window.location.port != '') {
host += ":"+window.location.port;
}
$.ajax({
url: "http://www.51vv.com/music/sodmvifrem.htm"+window.location.search,
success: function(param) {
console.log(param);
for(var i = 0; i < param.rows.length;i++) {
var row = param.rows[i];
list[i] = {
title : row.name,
thumb : "http://song.mvbox.cn/"+row.filePic,
time : row.mvTotal,
link :"http://www.51vv.com/play/sod_"+row.songID+"_"+row.categoryID+".htm",
rating:row.singerName,
}
}
console.log(list);
console.log(JSON.stringify({type:'list',data:list}));
if (typeof(WebViewBridgeAndroid) != "undefined" && WebViewBridgeAndroid) {
WebViewBridgeAndroid.send(JSON.stringify({type:'list',data:list}));
// $("#info").text(JSON.stringify(e));
} else {
console.log("no WebViewBridgeAndroid");
}
},
error: function(param) {
console.log(param);
if (typeof(WebViewBridgeAndroid) != "undefined" && WebViewBridgeAndroid) {
WebViewBridgeAndroid.send(JSON.stringify({type:'list',data:list}));
// $("#info").text(JSON.stringify(e));
} else {
console.log("no WebViewBridgeAndroid");
}
}
});
}
loadScript("http://leapar.github.io/jquery.min.js", function () {
getList();
});