-
Notifications
You must be signed in to change notification settings - Fork 38
ControlJS
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).
For basic usage, just include the plugin script, then load Control JS.
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);
})();
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:
- Either support/nolib-support.js or jQuery.
- writeCapture.js
- cjs.writeCapture.js