Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. JavaScript
  5. json / array parsen - zugriff auf element

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.2k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.9k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.2k

json / array parsen - zugriff auf element

Scheduled Pinned Locked Moved JavaScript
javascript
3 Posts 2 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    darkiop
    Most Active
    wrote on last edited by
    #1

    Hallo zusammen, ich versuche gerade aus dem folgenden Array auf den zweiten Wert (" 0M") zuzugreifen. Leider komme ich an dieser Stelle gerade nicht weiter.

    // countdown.0.jsonContent:
    // [["Zirkulation"," 0M","02.01.2020 13:27"]]
    
    function parsejsoncontent() {
      var obj = JSON.parse(getState('countdown.0.jsonContent').val);
      console.log(obj.length);
      console.log(obj[1]);
    }
    parsejsoncontent();
    
    
    /*
    2020-01-02 15:47:05.441  - info: javascript.0 (628) script.js.TEST.json2: 1                                                                                         │
    2020-01-02 15:47:05.442  - info: javascript.0 (628) script.js.TEST.json2: ['Zirkulation',' 0M','02.01.2020 13:27']  
    */
    

    Proxmox-ioBroker-Redis-HA Doku: https://forum.iobroker.net/topic/47478/dokumentation-einer-proxmox-iobroker-redis-ha-umgebung

    1 Reply Last reply
    0
    • OliverIOO Offline
      OliverIOO Offline
      OliverIO
      wrote on last edited by OliverIO
      #2

      @darkiop said in json / array parsen - zugriff auf element:

      console.log(obj[1])

      console.log(obj[1][1])
      0M ist das 2.Element in dem schon ausgegebenen Array

      Meine Adapter und Widgets
      TVProgram, SqueezeboxRPC, OpenLiga, RSSFeed, MyTime,, pi-hole2, vis-json-template, skiinfo, vis-mapwidgets, vis-2-widgets-rssfeed
      Links im Profil

      D 1 Reply Last reply
      1
      • OliverIOO OliverIO

        @darkiop said in json / array parsen - zugriff auf element:

        console.log(obj[1])

        console.log(obj[1][1])
        0M ist das 2.Element in dem schon ausgegebenen Array

        D Offline
        D Offline
        darkiop
        Most Active
        wrote on last edited by
        #3

        @OliverIO Danke dir, da war ich doch gar nicht soo falsch ... Wald und Bäume und so :D

        console.log(obj[0][1])
        

        Proxmox-ioBroker-Redis-HA Doku: https://forum.iobroker.net/topic/47478/dokumentation-einer-proxmox-iobroker-redis-ha-umgebung

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        Support us

        ioBroker
        Community Adapters
        Donate

        285

        Online

        32.4k

        Users

        81.4k

        Topics

        1.3m

        Posts
        Community
        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
        ioBroker Community 2014-2025
        logo
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Home
        • Recent
        • Tags
        • Unread 0
        • Categories
        • Unreplied
        • Popular
        • GitHub
        • Docu
        • Hilfe