Find file
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (47 sloc) 1.89 KB
env.js : A pure JavaScript browser environment.
Developed by John Resig (
Major Contributers:
Chris Thatcher (
GitHub repositories:
Mailing List:
Lighthouse (Bug Tracking):
Original blog post:
Rhino (Java-based JavaScript engine)
* run "ant concat"
* Creates a platform-agnostic "dist/env.js" file and a Rhino-specific "dist/env.rhino.js" file.
* run "ant test"
1) Include the proper env.js file for your platform.
load('env.rhino.js'); //if in a Rhino script
2) Tell env.js to load an HTML file from your file system that it should model:
window.location = "some/file.html";
3) Optionally trigger "document ready" events in one of these ways:
a) standard window.load method:
window.onload = function() { /* do something after DOM is loaded */};
window.location = "some/file.html";
b) jQuery ready method:
window.location = "some/file.html";
c) Other JavaScript frameworks have their own methods of setup, but the general pattern is:
// load env.js
// load your framework
// tell env.js the base DOM to model
// run any setup code for your framework
// tell the framework that the document is loaded
Testing jQuery Compatibility:
* run ./bin/ 1.2.6
* run ./bin/ 1.3.1
* Checks out the given jQuery tag from Subversion into test/vendor/jQuery/[version], moves dist/env.rhino.js into
the correct location in their tree, and runs the test suites.