Created
September 15, 2015 09:07
-
-
Save NorioKobota/3be9bbde030ccfe08070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>echo client</title> | |
<script type="text/javascript" src="./jquery.min.js"></script> | |
<script type="text/javascript" src="./linear.debug.js"></script> | |
<script type="text/javascript"> | |
var c; | |
window.onload = function() { | |
var t1 = {type: 'websocket', host: '127.0.0.1', port: 8000}; | |
c = new linear.client({transports: [t1]}); | |
c.connect(); | |
}; | |
function send() { | |
c.request({method: 'echo', params:$('#echo').val(), | |
onresponse: function(m) { | |
$('#echoback').text(m.result); | |
}}); | |
} | |
</script> | |
</head> | |
<body> | |
<h1>Echo client</h1> | |
<input id="echo" type="text"></input> | |
<button onclick="send()">send</button> | |
<div>echoback: <span id="echoback"></span></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment