-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
36 lines (31 loc) · 1007 Bytes
/
test.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Danny Kirschner">
<!-- Date: 2011-04-20 -->
</head>
<body>
<input type="text" id="query" /><button>search</button><br />
<div id="results">
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var query;
$('button').click(function(){
query=$("#query").val();
var url='http://gorankem.com:4000/api/v1/artist/tracks/'+query+'.js?callback=?';
$.getJSON(url,function(json){
$.each(json.tracks,function(i,track){
$("#results").append('<p>'+track.title+':'+track.rank+'</p>');
});
});
});
});
</script>
</body>
</html>