This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
README.md | Sat May 16 20:41:24 -0700 2009 | |
| |
engines/ | Thu Oct 15 19:06:58 -0700 2009 | |
| |
lib/ | Thu Oct 08 17:51:44 -0700 2009 | |
| |
package.json | Mon Nov 02 18:25:03 -0800 2009 | |
| |
test/ | Thu Oct 01 16:52:22 -0700 2009 |
README.md
browserjs
BrowserJS is a ServerJS compatible package that emulates portions of the browser JavaScript APIs.
Supported APIs
- XMLHttpRequest
- setTimeout, setInterval, clearTimeout, clearInterval
- console.log, error, warn, debug
- DOMParser and basic DOM operations (Rhino only)
Usage
To get access to individual APIs, require the corresponding module. For example, if you just w
var XMLHttpRequest = require("browser/xhr").XMLHttpRequest;
To get the "window" object, which contains all the APIs, require the "browser/window" module:
var window = require("browser/window");
Use the properties of the window object directly:
var request = new window.XMLHttpRequest();
Or you can bring all the properties of the "window" object into scope temporarily (without modifying the global scope) by using a with statement:
with (window) {
var request = new XMLHttpRequest();
}
If you want to permanently modify the global scope to include all the properties of "window" in the global scope, simply require the "browser" module:
require("browser")







