Skip to content
Noah Sloan edited this page Dec 26, 2010 · 2 revisions

We provide a small plugin for replacing Control JS's document.write support with writeCapture. It is available in the Downloads (e.g., writeCapture-1.0.5-forCjs-min.js includes writeCapture and the plugin).

Basic

For basic usage, just include the plugin script, then load Control JS.

Async

If you want all scripts to load async, then you can load the plugin asynchronously in the same way you would load Control JS. Since the plugin needs to run before loading Control JS, you can tell the plugin the path to Control JS and it will load it automatically:

(function() {
	window.writeCapture_cjsSrc = 'http://controljs.googlecode.com/svn-history/trunk/control.js';
	var script = document.createElement('script');
	script.src = "path/to/writeCapture-1.0.5-forCjs-min.js";
	var sib = document.getElementsByTagName('script')[0];
	sib.parentNode.insertBefore(script, sib);
})();

Advanced Loading Control

Technically, the plugin just needs to run before Control JS loads, so if you want to load Control JS yourself, just make sure the plugin runs first.

If you are not using the minified plugin from the downloads section, then the unminified sources need to be loaded in the following order:

  1. Either support/nolib-support.js or jQuery.
  2. writeCapture.js
  3. cjs.writeCapture.js
Clone this wiki locally