forked from JeffreyZhao/wind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweibo.html
68 lines (54 loc) · 2.47 KB
/
weibo.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
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Weibo - Jscex Sample</title>
<script type="text/javascript" src="../../src/jscex.js"></script>
<script type="text/javascript" src="../../src/jscex-parser.js"></script>
<script type="text/javascript" src="../../src/jscex-jit.js"></script>
<script type="text/javascript" src="../../src/jscex-builderbase.js"></script>
<script type="text/javascript" src="../../src/jscex-async.js"></script>
<script type="text/javascript" src="../../src/jscex-async-powerpack.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="jquery-bindings.js" type="text/javascript"></script>
<script type="text/javascript">
/*
$(document).ready(function () {
$("#btnSearch").click(function (){
$("#result").empty();
var keyword = encodeURIComponent($("#txtKeyword").val());
$.ajax({
url: "http://api.t.sina.com.cn/trends/statuses.json?trend_name=" + keyword + "&source=3355748460",
dataType: "jsonp",
success: function (data) {
$.each(data, function () {
$("#result").append("<li>" + this.text + "</li>");
});
}
});
});
});
*/
var goAsync = eval(Jscex.compile("async", function () {
$await($(document).readyAsync());
while (true) {
$await(Jscex.Async.onEvent($("#btnSearch").get(0), "click"));
$('#result').empty();
var keyword = encodeURIComponent($("#txtKeyword").val());
var result = $await($.ajaxAsync({
url: 'http://api.t.sina.com.cn/trends/statuses.json?trend_name=' + keyword + '&source=3355748460',
dataType: "jsonp"
}));
$.each(result.data, function () {
$('#result').append('<li>' + this.text + '</li>');
});
}
}));
goAsync().start();
</script>
</head>
<body>
<input type="text" value="Jscex" id="txtKeyword" />
<input type="button" value="Search" id="btnSearch" />
<ul id="result"></ul>
</body>
</html>