forked from lemonhall/douban-phantomjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (30 loc) · 835 Bytes
/
index.html
File metadata and controls
36 lines (30 loc) · 835 Bytes
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
<html>
<head>
<title>Captcha</title>
</head>
<body>
<script src="/socket.io/socket.io.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<img id="captcha_img"/></br>
<input id="captcha_text" type="text"/><br>
<input id="btn_ok" type="button" value="captcha"/>
<script>
var socket = io.connect('http://localhost:9000');
var captcha_img=$("#captcha_img");
var captcha_text=$("#captcha_text");
var btn_ok=$("#btn_ok");
btn_ok.bind("click",function(){
console.log(captcha_text.val());
var text=captcha_text.val();
socket.emit('Got_captcha', { text: text});
});
//console.log(captcha_img);
socket.on('news', function (data) {
//console.log(data);
var img_url=data.img_url;
//console.log(img_url);
captcha_img.attr("src",img_url);
});
</script>
</body>
</html>