Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. English
    3. Scripting / Logic
    4. JavaScript
    5. Enable DOM objects for javascript and typescript [gelöst]

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Enable DOM objects for javascript and typescript [gelöst]

    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      Ethernet-Fellow last edited by Ethernet-Fellow

      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

      liv-in-sky 1 Reply Last reply Reply Quote 0
      • Jey Cee
        Jey Cee Developer last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • E
          Ethernet-Fellow last edited by

          Thanks Jey Cee,
          I didn't find an editable table. So I tried to implement it by Typescript.

          1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @Ethernet-Fellow last edited by

            @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

            1 Reply Last reply Reply Quote 0
            • E
              Ethernet-Fellow last edited by

              Hi liv-in-sky,
              I tried to make a table in VIS using HTML and typescript, but the typescript does not know DOM elements.

              liv-in-sky 1 Reply Last reply Reply Quote 0
              • liv-in-sky
                liv-in-sky @Ethernet-Fellow last edited by

                @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

                1 Reply Last reply Reply Quote 1
                • E
                  Ethernet-Fellow last edited by

                  Thanks a lot liv-in-sky,
                  that's what I missed.

                  liv-in-sky 1 Reply Last reply Reply Quote 1
                  • liv-in-sky
                    liv-in-sky @Ethernet-Fellow last edited by

                    @ethernet-fellow

                    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

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    907
                    Online

                    31.8k
                    Users

                    80.0k
                    Topics

                    1.3m
                    Posts

                    javascript
                    3
                    8
                    681
                    Loading More Posts
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes
                    Reply
                    • Reply as topic
                    Log in to reply
                    Community
                    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                    The ioBroker Community 2014-2023
                    logo