Browse files

Updates to examples/helloworld_example: Added package.json; Improved JS.

  • Loading branch information...
1 parent f782ebf commit ec78b9e7bc608d5f97b898107a0dce547ee78b07 @mrienstra committed Feb 17, 2012
Showing with 25 additions and 2 deletions.
  1. +9 −2 examples/helloworld_example/helloworld.html
  2. +16 −0 examples/helloworld_example/package.json
View
11 examples/helloworld_example/helloworld.html
@@ -16,9 +16,16 @@
$("#text-input").val("");
});
-
+ $("#text-input").keypress(function (e) {
+ if (e.which && e.which === 13) {
+ $("#send-button").click();
+ return false;
+ }
+ });
+
now.name = prompt("What's your name?", "");
-
+
+ $("#text-input").focus();
});
</script>
</head>
View
16 examples/helloworld_example/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "nowjs-helloworld-example",
+ "version": "0.0.6",
+ "author": "ericz (Eric Zhang) <eric@nowjs.com>",
+ "description": "'Hello world' example for NowJS.",
+ "keywords": [
+ "nowjs",
+ "example"
+ ],
+ "dependencies" : {
+ "now" : ">=0.7"
+ },
+ "engine": {
+ "node": ">=0.4"
+ }
+}

0 comments on commit ec78b9e

Please sign in to comment.