Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Frage zu URL() im Javascript adapter

    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

    Frage zu URL() im Javascript adapter

    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chris299 last edited by

      Hallo zusammen,
      ich bin Javascript-anfänger und steh grad auf dem Schlauch:
      Sollte URL() als Objekt im Javascript-adapter (aktuelle stable Version v8.9.2 ) funktionieren?

      const myURL = new URL("https://example.org/abc?foo=~bar");
      
      console.log(myURL.search);  // prints ?foo=~bar
      
      // Modify the URL via searchParams...
      myURL.searchParams.sort();
      
      console.log(myURL.search);  // print
      

      ich bekomme da nur einen Fehler:

      ReferenceError: URL is not defined
      

      obwohl die Definition ja sogar angezeigt wird:
      c3d7e1ac-1d7a-499f-8761-ae2cd974e8c6-grafik.png

      98ca1f9f-d428-4895-8ee4-8a8203cf85df-grafik.png

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

        füge das oben ein :

        const { URL } = require('url'); 
        
        C 1 Reply Last reply Reply Quote 0
        • C
          chris299 @liv-in-sky last edited by

          @liv-in-sky vielen Dank! 🙏

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

          Support us

          ioBroker
          Community Adapters
          Donate

          423
          Online

          31.8k
          Users

          80.0k
          Topics

          1.3m
          Posts

          2
          3
          85
          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