]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Update README.md
authorSaswat Das <saswatds@users.noreply.github.com>
Sat, 17 Dec 2016 23:18:19 +0000 (04:48 +0530)
committerGitHub <noreply@github.com>
Sat, 17 Dec 2016 23:18:19 +0000 (04:48 +0530)
Added Getting started content from the xtermjs.org website

README.md

index 6ac33d4ab9710a20bd10056e2c74ca67d6967ee2..0c178c5854ced6ea32ab9f234e4013b355d21c98 100644 (file)
--- a/README.md
+++ b/README.md
@@ -54,25 +54,25 @@ Then open http://0.0.0.0:3000 in a web browser (use http://127.0.0.1:3000 if run
 
 ## Getting Started
 
-To attact the xterm `Terminal` to a parent div
-
+To start using xterm.js on your browser, add the `xterm.js` and `xterm.css` to the head of your html page. Then create a `<div id="terminal"></div>` onto which xterm can attach itself.
 ```html
-<div id="terminal"></div>
-```
-
-```js
-var term = new Terminal();
-term.open(document.getElementById('#terminal'));
-term.write('Hello from \033[1;3;31mxterm.js\033[0m $ ')
-```
-To get the data from xterm to send to a server or for proccessing you can
-
-```js
-function onDataReceived(data) {
-   // Your logic
-}
-term.on('data', onDataReceived);
+<!doctype html>
+  <html>
+    <head>
+      <link rel="stylesheet" href="bower_components/xterm.js/dist/xterm.css" />
+      <script src="bower_components/xterm.js/dist/xterm.js"></script>
+    </head>
+    <body>
+      <div id="terminal"></div>
+      <script>
+       var term = new Terminal();
+        term.open(document.getElementById('#terminal'));
+        term.write('Hello from \033[1;3;31mxterm.js\033[0m $ ')
+      </script>
+    </body>
+  </html>
 ```
+Finally instantiate the `Terminal` object and then call the `open` function with the DOM object of the `div`.  
 
 ## Addons