mirror of
https://github.com/Hopiu/webapi-eca.git
synced 2026-04-18 13:51:02 +00:00
41 lines
No EOL
982 B
HTML
41 lines
No EOL
982 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Invoke an event</title>
|
|
<link rel="stylesheet" type="text/css" href="style.css">
|
|
<script src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>
|
|
</head>
|
|
<body>
|
|
<div id="mainbody">
|
|
<div id="pagetitle">Invoke an Event</div>
|
|
<p>
|
|
<textarea id="textarea_event" rows="20" cols="50">
|
|
{
|
|
"event": "mail",
|
|
"eventid": "mail_0",
|
|
"payload": {
|
|
"subject": "hello"
|
|
}
|
|
}
|
|
</textarea>
|
|
</p>
|
|
<p>
|
|
<button id="but_submit">invoke</button>
|
|
</p>
|
|
</div>
|
|
|
|
<script>
|
|
//{ \"event\": \"mail\", \"eventid\": \"0\",... }"
|
|
$('#but_submit').click(function() {
|
|
$.post('../event', JSON.parse($('#textarea_event').val()))
|
|
.done(function(data) {
|
|
alert(data);
|
|
})
|
|
.fail(function(err) {
|
|
console.log(err);
|
|
alert('Posting of event failed: ' + err);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |