Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (41 sloc) 1.11 KB
<!DOCTYPE html>
<html lang="en">
<title>nowjs test</title>
<script type="text/javascript" src=""></script>
<script src="/nowjs/now.js"></script>
now.receiveMessage = function(name, message){
$("#messages").append("<br><b>" + name + "</b>: " + message);
$("#text-input").keypress(function (e) {
if (e.which && e.which === 13) {
return false;
}); = prompt("What's your name?", "");
<a href="#" class="change selected">room 1</a> -
<a href="#" class="change">room 2</a> -
<a href="#" class="change">room 3</a>
<div id="messages"><br>You're in room 1</div>
<input type="text" id="text-input">
<input type="button" value="Send" id="send-button">
Something went wrong with that request. Please try again.