Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Abhara Huq

    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

    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Groups 0

    Abhara Huq

    @Abhara Huq

    0
    Reputation
    6
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Abhara Huq Follow

    Latest posts made by Abhara Huq

    • Json Datei mit HTML Datei vebinden

      Hallo!
      Ich habe ein Problem. Meine HTML Datei sieht wie folgt aus:

      <!DOCTYPE html>
      <html>
      <head>
          <title>JSON Script</title>
      </head>
      <body>
      <script>
              // JSON-Datei laden
              fetch('C:\Users\HUQ3FE\Documents\HTML Übungen\json1.json')
                  .then(response => response.json()) // JSON-Inhalt als Objekt lesen
                  .then(data => {
                      // Code aus JSON ausführen
                      eval(data.code);
                  })
                  .catch(error => console.error('Fehler beim Laden der JSON-Datei:', error));
          </script>
          <p id="demo"></p>
      
          
      </body>
      </html>
      

      Meine Json Datei:

      {
        "code": "document.getElementById('demo').innerHTML = 5 + 6;"
      }
      
      
      

      Eigentlich sollte, wenn ich die HTML datei öffne im Browser, die Zahl 11 erscheinen. Aber das klappt nicht. Chat GPT hat leider auch nicht geholfen... Vielleicht weiß hier jemand mehr
      Danke 🙂

      posted in Off Topic
      Abhara Huq
      Abhara Huq
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo