NEWS
Enable DOM objects for javascript and typescript [gelöst]
-
The simple type- and javascript statement
document.getElementById('xxx')
returns a syntax error: 'document' unknown.
On Google I found that the DOM objects are not enabled by default in typescript.
To enable it the typescript configuration file 'tsconfig.json' file must contain the line
"lib": ["DOM", "ES2017"],
to enable the DOM objects for typescript (and also for javascript).
I inserted that line in /opt/iobroker/node_modules/@iobroker/plugin-base/tsconfig.json
without success. On my Raspi there are about 20 more such file.So my question, does anyone know how to enable the DOM objects for type- and javascript in iobroker.
Thanks a lot -
Thanks Jey Cee,
I didn't find an editable table. So I tried to implement it by Typescript. -
The simple type- and javascript statement
document.getElementById('xxx')
returns a syntax error: 'document' unknown.
On Google I found that the DOM objects are not enabled by default in typescript.
To enable it the typescript configuration file 'tsconfig.json' file must contain the line
"lib": ["DOM", "ES2017"],
to enable the DOM objects for typescript (and also for javascript).
I inserted that line in /opt/iobroker/node_modules/@iobroker/plugin-base/tsconfig.json
without success. On my Raspi there are about 20 more such file.So my question, does anyone know how to enable the DOM objects for type- and javascript in iobroker.
Thanks a lot@ethernet-fellow the DOM elements are only available in the vis.
to use it you have to write scripts in the vis editor or in the e.g. html standard widget
do I misunderstand your question ?
what you want to do
-
Hi liv-in-sky,
I tried to make a table in VIS using HTML and typescript, but the typescript does not know DOM elements. -
Hi liv-in-sky,
I tried to make a table in VIS using HTML and typescript, but the typescript does not know DOM elements.@ethernet-fellow I only use javascript - it is working
example: a script which builds the html und jquery - in the vis you have to use the binding for the datapoint
https://forum.iobroker.net/topic/51217/html-tabelle-für-zigbee-devices-vis-übersicht
or this exampleis in the script-tab in the vis-editor:
https://forum.iobroker.net/topic/48663/howto-skripte-im-vis-editor-mit-jquery
-
Thanks a lot liv-in-sky,
that's what I missed. -
Thanks a lot liv-in-sky,
that's what I missed.you're welcome
by the way - for example : fast tables for vis:
https://forum.iobroker.net/topic/48130/howto-schnell-erstellte-html-tabelle-für-vis
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden