Menu

linknx javasript

Help
kervy
2009-03-25
2012-12-14
  • kervy

    kervy - 2009-03-25

    I have find this code python which allows to throw one to command linknx :

    import socket

    ip = "192.168.1.50"
    port = 1028

    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((ip, port))

    msgs = [ "<read><object id='light1'/></read>\n\4",
    "<write><object id='light' value='on'/></write>\n\4" ]

    for msg in msgs:
    s.send(msg)
    data = s.recv(1024)
    print data

    s.close()

    I want to make the same thing in javascript. what is code?

     
    • jef2000

      jef2000 - 2009-03-26

      If javascript is running in a web browser, it's not possible to open a TCP socket for security reasons. The only connections that a script can do in the context of a web browser is a connection to the web server that served the web page containing the script.

      Regards,

      Jean-François

       
    • kervy

      kervy - 2009-03-26

      ok

      what is a code javascprit into the web server?????

      What is a code in html for connect web brower at script in web server????

      regard

      kerv

       
    • jef2000

      jef2000 - 2009-03-26

      Hi,

      Sorry, but I will not make a private course on web applications for you. There is enough documentation on this topic all over the web, so RTFM. By the way, access linknx from a web browser using javascript is exactly what knxweb does, so if you want an example of how to do it, just look at knxweb.

      Regards,

      Jean-François

       
    • kervy

      kervy - 2009-03-26

      ok I look KNXWEB
      thanks

      regards

      kerv

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.