Created
September 5, 2015 05:40
-
-
Save maxchehab/112bbad99d802e5749ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!-- save as index.html --> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script src="/socket.io/socket.io.js"></script> | |
</head> | |
<body> | |
<script> | |
var socket = io.connect('http://localhost'); | |
socket.on('field', function (data) { | |
console.log(data); | |
$("#field").html(data); | |
}); | |
</script> | |
Data: <div id="field"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment