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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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
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
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
ok I look KNXWEB
thanks
regards
kerv