-
The HTML grammar definition (HTML DTD)
-
DOM, The output tree - the "parse tree" is a tree of DOM element and attribute nodes. Document Object Model
-
The parsing algorithm
- consists of two stages - tokenization and tree construction.
- state machine
| /* | |
| jsclass | |
| http://jsclass.jcoglan.com/ | |
| npm install jsclass | |
| */ | |
| require('jsclass'); | |
| JS.require('JS.Deferrable'); | |
| Promise = new JS.Class({ | |
| include: JS.Deferrable, |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
| <!-- <script type="text/javascript" src="/home/haiswu/Downloads/jquery-1.7.1.js"></script> --> | |
| <style> | |
| form div label { | |
| width: 100px; | |
| } |
| module Main where | |
| main = do let p = Position 0 | |
| print (treasureMap p == treasureMap2 p) | |
| data Position t = Position t deriving (Show, Eq) | |
| stagger (Position d) = Position (d + 2) |
| ## Sample config for setting nginx as a gateway to local services. | |
| upstream demosnap { | |
| server localhost:9898; | |
| server localhost:8080; | |
| } | |
| server { | |
| listen 80; |
sudo apt-get install xmonad suckless-tools gmrun xmobar
sudo apt-get install lxappearance ttf-liberation ttf-mscorefonts-installer
| module Main where | |
| import Control.Monad.Trans.State.Lazy | |
| -- | The state | |
| type S = String | |
| sayHello :: S -> S | |
| sayHello = (++ "Hello, ") |
| var Parent = Backbone.Model.extend({ | |
| age : 3, | |
| ref: [] | |
| }); | |
| var Child1 = Parent.extend(), | |
| Child2 = Parent.extend(); | |
| var c1 = new Child1(), | |
| c2 = new Child2(); |
| <!-- This is a Node+WebSocket powered demo to sync videos | |
| across different browsers. This file is the client, | |
| the other one is the Node server. Powered by Node and | |
| http://github.com/miksago/node-websocket-server --> | |
| <style> | |
| .inactive { display: none; } | |
| .active { display: block; } | |
| </style> | |
| <script> |