Hi
I'm trying to setup the ESP8266 as a mini webserver specificlaly to control a small deivce. Everything is generally working well.
But I have a problem in the following code.
Just a bit of background, the webpage has just a few controls on it (buttons and labels mainly) and one input time field. I'd like to set the default for this to what has been set previously and is stored in the ESP8266 (I have to do it this way rather than using the client as there could be multiple clients). I'm using the window.onload to do this (there may be other ways)
The first code snippet works fine, but the second doesn't. I suspect it is something to do with UTF-8 (I believe B4R uses) v. UTF-16 (I beleive HTML pages use)
Could someone confirm that it is to do with the UTF coding or offer any other cause/solution, and if it is to do with UTF coding, is there a routine anywhere that would convert from UTF-8 to UTF-16.
This works fine:
Bute this doesn't work:
Many thanks in advance
Dave
I'm trying to setup the ESP8266 as a mini webserver specificlaly to control a small deivce. Everything is generally working well.
But I have a problem in the following code.
Just a bit of background, the webpage has just a few controls on it (buttons and labels mainly) and one input time field. I'd like to set the default for this to what has been set previously and is stored in the ESP8266 (I have to do it this way rather than using the client as there could be multiple clients). I'm using the window.onload to do this (there may be other ways)
The first code snippet works fine, but the second doesn't. I suspect it is something to do with UTF-8 (I believe B4R uses) v. UTF-16 (I beleive HTML pages use)
Could someone confirm that it is to do with the UTF coding or offer any other cause/solution, and if it is to do with UTF coding, is there a routine anywhere that would convert from UTF-8 to UTF-16.
This works fine:
B4X:
Astream.Write ("<script>")
Astream.Write ("window.onload = function() {document.getElementById('FeedTime').value =""12:34"";}")
Astream.Write ("</script>")
Bute this doesn't work:
B4X:
Astream.Write ("<script>")
Dim FeedTimeString as String = "12:34"
Astream.Write ("window.onload = function() {document.getElementById('FeedTime').value = """).Write(FeedTimeString).Write(""";}")
Astream.Write ("</script>")
Many thanks in advance
Dave