Wie eine Js-Datei in meinem XBL aufzunehmen?
-
05-10-2019 - |
Frage
Gibt es eine Möglichkeit, eine Javascript-Datei in eine XBOX aufzunehmen statt Kopie alle das Skript es?
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