forked from Prinzhorn/twitter-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (61 loc) · 1.66 KB
/
index.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>TwitterWidgetsLoader demo</title>
</head>
<body>
<h1>TwitterWidgetsLoader demo</h1>
<h2>First tweet (first load() call)</h2>
<div id="tweet1"></div>
<h2>Second tweet (second load() call, queued after first)</h2>
<div id="tweet2"></div>
<h2>Third tweet (load() was called inside another load() handler)</h2>
<div id="tweet3"></div>
<h2>Fourth tweet (load() was called after 5s delay)</h2>
<div id="tweet4"></div>
<h2>Follow button</h2>
<div id="follow"></div>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript">
TwitterWidgetsLoader.load(function(err, twttr) {
if(err) {
console.error(err);
return;
}
twttr.widgets.createFollowButton('Prinzhorn', document.getElementById('follow'));
});
TwitterWidgetsLoader.load(function(err, twttr) {
if(err) {
console.error(err);
return;
}
twttr.widgets.createTweet('20', document.getElementById('tweet1'));
});
TwitterWidgetsLoader.load(function(err, twttr) {
if(err) {
console.error(err);
return;
}
twttr.widgets.createTweet('20', document.getElementById('tweet2'));
TwitterWidgetsLoader.load(function(err, twttr) {
if(err) {
console.error(err);
return;
}
twttr.widgets.createTweet('20', document.getElementById('tweet3'));
});
});
setTimeout(function() {
TwitterWidgetsLoader.load(function(err, twttr) {
if(err) {
console.error(err);
return;
}
twttr.widgets.createTweet('20', document.getElementById('tweet4'));
});
}, 5 * 1000);
</script>
</body>
</html>