-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.html
More file actions
49 lines (48 loc) · 1.19 KB
/
example.html
File metadata and controls
49 lines (48 loc) · 1.19 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-type' content='text/html; charset=utf-8' />
<title>ircjson.js example</title>
<script type='text/javascript' src='ircjson.js'></script>
<script type='text/javascript'>/*<![CDATA[*/
timer = null
tosend = null
tosend_now = null
ircjson.host = "http://6irc.net/api/6ircremote-1.0/";
ircjson.apikey = "BETAKEY";
ircjson.onConnect = function() {
ircjson.send("6IN:USER "+prompt("What's your nickname?", ""));
}
ircjson.onReply = function(d) {
document.getElementById("replies").innerHTML +=
d.split("&").join("&").split("<").join("<").split(">").join(">") + "<br />\n";
}
ircjson.onGotReplies = function() {
if(tosend) {
tosend_now = tosend
tosend = null
setTimeout("ircjson.send(tosend_now);", 400);
}
else {
setTimeout("ircjson.poll();", 400);
}
}
function initme() {
ircjson.init();
}
function handleme() {
tosend = document.getElementById("text").value;
document.getElementById("text").value = "";
return false;
}
/*]]>*/</script>
</head>
<body onload='initme()'>
<div id='replies'>
</div>
<form onsubmit='return handleme()'>
<input type='text' id='text'>
<input type='submit' value='Send'>
</form>
</body>
</html>