This AI is still in early stages of development.
Check.NOT_LOADED
Indicates a script is not yet loaded, or must not be loaded, depending on the Check function being used...
Notes
This constant can be used in two scenarios:
Checking if a script is not yet loaded via Check.has() and Check.versionOf() functions
Requiring a script not to be loaded via the Check.doWhen() and Check.required() functions
Examples
Checking if a script is not loaded...
if (Check.versionOf("foo.js") == Check.NOT_LOADED) {
// foo.js is not loaded
}
// this will attempt to load foo.js if not already loaded...
if (Check.has("foo.js") == Check.NOT_LOADED) {
// tried to load foo.js but did not succeed
} else {
// foo.js autoloaded or was already loaded
}
// this will not attempt to autoload foo.js...
if (Check.has("foo.js", Check.NOT_LOADED)) {
// foo.js is not loaded
} else {
// foo.js was already loaded
}Requiring a script to be not loaded...
var dependencies = {
"bar.js": Check.ANY_VERSION,
"foo.js": Check.NOT_LOADED
};
// the task will only run if bar.js is loaded and foo.js is *not* loaded
Check.doWhen(dependencies, self, task);
// will throw an error if bar.js is not loaded or foo.js is loaded
Check.required(dependencies, self);