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 -
That doesn't make sense.
DOM objects are only available on web pages, ioBroker is complete server side based and uses nodejs.
So it useless there.
If you wan't this feature anyway you have to include a third party module. -
Thanks Jey Cee,
I didn't find an editable table. So I tried to implement it by Typescript. -
@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. -
@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. -
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