Created
June 21, 2012 06:20
-
-
Save bcamarda/2964186 to your computer and use it in GitHub Desktop.
JS Chat
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
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>untitled</title> | |
<meta name="generator" content="TextMate http://macromates.com/"> | |
<meta name="author" content="Apprentice"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="http://codeclasschat.herokuapp.com/helpers.js"></script> | |
<!-- Date: 2012-06-20 --> | |
</head> | |
<body> | |
<script> | |
jQuery(document).ready(function(){ | |
helpers.sendMessage("we're in business") | |
setInterval(function(){ | |
helpers.fetchNewMessages(function(messages){ | |
$.each(messages, function(i, message){ | |
helpers.renderMessage(message); | |
}); | |
}); | |
}); | |
}, 2000); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment