Frage

Gibt es eine Möglichkeit, eine Javascript-Datei in eine XBOX aufzunehmen statt Kopie alle das Skript es?

War es hilfreich?

Lösung 2

Ich fand, dass ich es in die XUL-Datei hinzufügen, so dass ich es in der XBL verwenden kann.

Andere Tipps

Ich glaube, es ist:

<xbl:script src="/xbl/foo/bar/myScript.js"/>

If you only need to run the script once and it doesn't need to access your document (i.e. it just defines methods) then the easiest way is to turn it into a module, see https://developer.mozilla.org/en/Components.utils.import but if you need the script to run once per element then you will need to use the subscript loader (see the link from the above page).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top