Permalink
Browse files

Proposed README file changes for v1.1 release.

  • Loading branch information...
1 parent aa066b6 commit 7c283f98d650bcc8dde2ef9f2b1a7380caa0372f @gleneivey gleneivey committed Oct 26, 2009
Showing with 24 additions and 10 deletions.
  1. +24 −10 README
View
34 README
@@ -53,35 +53,49 @@ Installing:
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";
Envjs("some/file.html");
+ or
+ var someWindow = window.open("some/file.html");
+ or
+ window.location = "some/file.html";
Optionally you can turn on/off settings by passing an options object:
Envjs("some/file.html", {log: function(msg){ console.debug(msg) }});
3) Optionally trigger "document ready" events in one of these ways:
- a) standard window.load method:
+4) Start processing of window(s)' event queue:
+ Envjs.wait();
+
+All together, the steps could be:
+
+ a) simplest method:
load('env.rhino.js');
- window.location = "some/file.html";
Envjs("some/file.html");
-
+ Envjs.wait();
+
b) jQuery ready method:
load('env.rhino.js');
load('jquery-1.3.2.js');
Envjs("some/file.html");
load('some-code-that-sets-up-jquery-onready-behaviors.js')
jQuery.ready();
+ Envjs.wait();
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
+ // step 1: load env.js
+ // optionally: load your framework(s)
+ // step 2: tell env.js the base DOM to model
+ // optionally: run any setup code for your framework(s0
+ // step 3: tell the framework that the document is loaded
+ // step 4: Envjs.wait();
+
+Note that env.js is currently limited to loading a single HTML page
+from the original window. If you are going to load multiple pages in
+succession into the same window, load the first into a new window
+object using window.open().
-
Testing jQuery Compatibility:
* run ./bin/test-jquery.sh 1.3.2
* run ./bin/test-jquery.sh 1.3.1

0 comments on commit 7c283f9

Please sign in to comment.