NEWS
Javascript include
-
Hallo zusammen,
ich habe inzwischen eine ganze Menge Scripte angelegt. Da ich z.B.: Icons (Emojis), Konfigurationen oder Telegram-Benachrichtigungen in mehreren Scripten benutze, habe ich viel doppelten Code.
Gibt es eine Möglichkeit, zentrale (=wiederverwendete) Elemente oder Funktionen in einem zentralen Script zu halten und dieses bei Bedarf in ein Script einzubinden?
Also quasi wie das <include>, das man bei klassischem JS verwendet.
Die Frage ist: wie lautet der Pfad zum Script?</include>
-
Oh, das war mir zu einfach ;-)
Dankeschön!!! `
siehe docu : https://github.com/ioBroker/ioBroker.ja … -functions
<size size="200">Global functions</size>
You can define the global scripts in the "global" folder. All global scripts are available on all instances. If global script is disabled, it will not be used. Global script will be just prepend to the normal script and compiled, so you cannot share data between scripts via global scrips. Use states for it.