Jump to content

Search the Community

Showing results for tags 'typo'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello, looks like there's a minor error in the example code given for the index.html page for the "Node.js and Raspberry Pi - Webserver with WebSocket" page (which I'm very grateful was provided, btw). Half way through the article, there's an index.html example that has an extra html opening tag, and extra close body and html tags. It's not an issue for people who realize the issue, but figured the page could use a quick update if possible. Thank you for all the great content! Ref: https://www.w3schools.com/nodejs/nodejs_raspberrypi_webserver_websocket.asp <!DOCTYPE html> <html> <body> <h1>Control LED light</h1> <p><input type="checkbox" id="light"></p> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script> <!-- include socket.io client side script --> <script> var socket = io(); //load socket.io-client and connect to the host that serves the page window.addEventListener("load", function(){ //when page loads var lightbox = document.getElementById("light"); lightbox.addEventListener("change", function() { //add event listener for when checkbox changes socket.emit("light", Number(this.checked)); //send button status to server (as 1 or 0) }); }); socket.on('light', function (data) { //get button status from client document.getElementById("light").checked = data; //change checkbox according to push button on Raspberry Pi socket.emit("light", data); //send push button status to back to server }); </script> </html> </body> </html>
×
×
  • Create New...