This code reads the slider and in the last line prints it successfully to the page as a debug step. But the line that puts the x variable in the url results in the url looking like this:
http://192.168.1.174/?somevar= x
And then my Lua program borks at trying to use x as the pwm parameter. I have tried endless methods of converting the var x to a string but so far nothing works. This is my first exposure to javascript.
Can someone tell me how to successfully pass the slider value in the url? Thanks!!!
conn:send('<script>')
conn:send('function myFunction() {')
conn:send(' var x = document.getElementById("cmd").value;')
conn:send(' document.location.href=\"?somevar= x ";')
conn:send(' document.getElementById("demo").innerHTML = x ;')
conn:send('}</script>')