• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Get the correct JSON data

Scheduled Pinned Locked Moved Development
15 Posts 2 Posters 1.1k Views 2 Watching
Loading More Posts
  • 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.
  • S Offline
    sdetweil @htilburgs
    last edited by Nov 13, 2024, 12:45 PM

    @htilburgs you can set a variable to the array locations and not move the data. of course the data element names may have changed , but that is an editor find/replace function

    send the whole response up to the module

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    H 1 Reply Last reply Nov 13, 2024, 12:59 PM Reply Quote 0
    • H Offline
      htilburgs @sdetweil
      last edited by Nov 13, 2024, 12:59 PM

      @sdetweil
      As I told you I have to figure out how. I always have problems with understanding how JSON works. But no problem, it keeps me of the streets.
      I haven’t been active for the last 3 years, but now I’ve found time and trying to complete / change some modules.
      But thanks for you help.

      (still trying to learn JS, but not afraid to ask) ☺

      S 1 Reply Last reply Nov 13, 2024, 1:05 PM Reply Quote 0
      • S Offline
        sdetweil @htilburgs
        last edited by Nov 13, 2024, 1:05 PM

        @htilburgs

        let foovar = payload.liveweer[0]

        then you can use foovar to reference the data

        json is just a text description of an object
        it coverts directly into js with the same structure

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        H 2 Replies Last reply Nov 13, 2024, 1:27 PM Reply Quote 0
        • H Offline
          htilburgs @sdetweil
          last edited by Nov 13, 2024, 1:27 PM

          @sdetweil said in Get the correct JSON data:

          coverts directly into js with the same structure

          I will try tonight. I’m at work (yeh right ;-) right now.

          (still trying to learn JS, but not afraid to ask) ☺

          1 Reply Last reply Reply Quote 0
          • H Offline
            htilburgs @sdetweil
            last edited by Nov 13, 2024, 2:11 PM

            @sdetweil said in Get the correct JSON data:

            let foovar = payload.liveweer[0]

            Is there a simple way to check what is in foovar?

            (still trying to learn JS, but not afraid to ask) ☺

            S 1 Reply Last reply Nov 13, 2024, 2:18 PM Reply Quote 0
            • S Offline
              sdetweil @htilburgs
              last edited by Nov 13, 2024, 2:18 PM

              @htilburgs console.log() same as before, BUT it is displayed in the developers window console table when its in the browser side module.js (modulename.js)

              ctrl-shift-i, select the console tab

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              H 1 Reply Last reply Nov 13, 2024, 7:23 PM Reply Quote 0
              • H Offline
                htilburgs @sdetweil
                last edited by Nov 13, 2024, 7:23 PM

                @sdetweil Thanks, that works!
                Now I can really see what I’m doing.

                (still trying to learn JS, but not afraid to ask) ☺

                1 Reply Last reply Reply Quote 1
                • 1
                • 2
                • 2 / 2
                2 / 2
                • First post
                  13/15
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy