Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>XSockets - WeAreTheRealTimeWeb</title>
- <script src="/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
- <script src="/Scripts/JXSockets.1.0.6.beta.js" type="text/javascript"></script>
- <script type="text/javascript">
- var ws = null;
- $(function () {
- ws = new jXSockets.xWebSocket("ws://127.0.0.1:4502/Test", jXSockets.WEBSOCKET);
- ws.bind("open", function () {
- ws.bind("xsockets.storage.get", function (data) {
- console.log(data);
- });
- });
- $("#Set").click(function () {
- ws.trigger("XSockets.Storage.Set", {Key:'foo', Value:$("#Value").val()});
- });
- $("#Get").click(function () {
- ws.trigger("XSockets.Storage.Get", { Key: 'foo'});
- });
- $("#Remove").click(function () {
- ws.trigger("XSockets.Storage.Remove", { Key: 'foo' });
- });
- });
- </script>
- </head>
- <body>
- <input type="text" id="Value" size="50" placeholder="Store this between websocket connections"/>
- <button id="Set">Set</button>
- <button id="Get">Get</button>
- <button id="Remove">Remove</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement