-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbotTest.html
More file actions
52 lines (47 loc) · 1.03 KB
/
botTest.html
File metadata and controls
52 lines (47 loc) · 1.03 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
50
51
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
function getContent(){
var settings = {
"async": true,
"crossDomain": true,
"url": "https://chatbotnode.herokuapp.com/test",
"method": "POST",
"headers": {
"content-type": "application/json"
},
"processData": false,
"data": JSON.stringify({
"object":"msg",
"entry":[
{
"messaging":[
{
"message":{
"text":$("#AssetId").val().trim()
}
}
]
}
]
})
}
$.ajax(settings).done(function (response) {
console.log(response);
$( "#resp" ).append( response );
$('#AssetId').val('');
});
}
</script>
</head>
<body>
<p>Start typing message in below texarea:</p>
User Says:<br/>
<textarea rows="5" cols="50" id="AssetId"></textarea><br/>
<input type="button" value="Send Message" onclick="javascript:getContent()" />
<p>Bot Reply: <span></span></p>
<textarea rows="10" cols="50" id="resp" disabled="true"></textarea>
</body>
</html>