nsIScriptLoader

IID:339a4eb5-dac6-4034-8c43-f4f8c645ce57
Inherits From:nsISupports

Properties

PRBool enabled

Whether the loader is enabled or not. When disabled, processing of new script elements is disabled. Any call to processScriptElement() will fail with a return code of NS_ERROR_NOT_AVAILABLE. Note that this DOES NOT disable currently loading or executing scripts.


Methods

void addObserver ( nsIScriptLoaderObserver observer ) void dropDocumentReference ( ) nsIScriptElement getCurrentScript ( ) void init ( nsIDocument document ) void processScriptElement ( nsIScriptElement element , nsIScriptLoaderObserver observer ) void removeObserver ( nsIScriptLoaderObserver observer )

void addObserver ( nsIScriptLoaderObserver observer )

Add an observer for all scripts loaded through this loader.

Arguments:
observer: observer for all script processing.

void dropDocumentReference ( )

The loader maintains a strong reference to the document with which it is initialized. This call forces the reference to be dropped.


nsIScriptElement getCurrentScript ( )

Gets the currently executing script. This is useful if you want to generate a unique key based on the currently executing script.


void init ( nsIDocument document )

Initialize loader with a document. The container of this document will be used for getting script evaluation information, including the context in which to do the evaluation. The loader maintains a strong reference to the document.

Arguments:
document: The document to use as the basis for script processing.

void processScriptElement ( nsIScriptElement element , nsIScriptLoaderObserver observer )

Process a script element. This will include both loading the source of the element if it is not inline and evaluating the script itself.

Arguments:
element: The element representing the script to be loaded and evaluated.
observer: An observer for this script load only

void removeObserver ( nsIScriptLoaderObserver observer )

Remove an observer.

Arguments:
observer: observer to be removed

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com