frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

HTTP CONNECTION BETWEEN PAGE HTML AND PHOTON

hello, I created an html page with jquery where sending a get request to the address 192.168.1.100 (IP of my photon). (specifically 192.168.1.100/value) the photon receives the request, he takes the url and deals to manage that concerns the value.
Now I have to send a value to 192.168.1.100 page so that my initial HTML page receives the value in the photon page.
I do this:
print ( "HTTP / 1.1 200 OK \ r", stream = client)
         print ( "Content-Type: text / html \ r", stream = client)
         print ( "<html> <body>" value "</ body> </ html>", stream = client)
I have a size problem, I can not retrieve the value, I tried to turn it into json but niente.Qualcuno know how to do?
Also another way to send the data to a web page

Comments

  • <!DOCTYPE html>
    <html>
    <head>
     
    <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
     
    </head>
    <body>


     
    <script type="text/javascript" >
     
    $.get("http://192.168.1.100/value", function (data, status) {
        alert(data);
    })
    .fail(function (jqXHR, textStatus) {
      alert("Request failed: " + textStatus);
    });

    </script>

    </body>
    </html>
  • this is page.html
Sign In or Register to comment.

ZERYNTH Community

@ 2016 Zerynth.com, all rights reserved.