PINK program help
Paul
Posts: 263
Hello, How do I get the PINK variable <NB_var01> into a JavaScript variable? I'm sure its simple but I have little experience in programming in HTML or JavaScript.
I've tried the following without success:
1. var·myvalue = document.getElementsByName('NB_var01').value; //undefined
2. window.status = <NB_var01>;· //errors out
Thanks, any help will be appreciated.
Paul
I've tried the following without success:
1. var·myvalue = document.getElementsByName('NB_var01').value; //undefined
2. window.status = <NB_var01>;· //errors out
Thanks, any help will be appreciated.
Paul

Comments
I have contacted the developer of the firmware to see if this is supported and how. I will post what I find. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <script type="text/javascript"> function load() { var myVal=document.getElementById('myTable').cells alert(myVal[noparse][[/noparse]2].innerHTML) //shows Nb_var02 value } </script> </head> <body onload="load()"> <table id="myTable" border="0" width="10px"> <tr><!-- Row 1 --> <td><Nb_var00></td> <td><Nb_var01></td> <td><Nb_var02></td> <td><Nb_var03></td> <td><Nb_var04></td> </tr> </table> </body> </html>Thanks for sharing your success. This could help others in the future. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I decided to do a little playing around myself since one of my test applications is a remote security station. In order for it to work I need the web page to refresh every 5 seconds (very easy to do) and update the information on the page. But more importantly I need to detect when a variable is set to a certain value and cause the page to redirect. I am doing this with JavaScript and this required me to figure out how to get the variable into a JS variable. Please see the attached snippet from my PINK test page. I hope this helps someone out. Take care.
<script type="text/javascript"> var d="<Nb_var00>" document.writeln(d) if (d==="SEARCH") { window.location = "[url=http://www.google.com/]http://www.google.com/[/url]" } </script>The above example jumps to Google when the variable <Nb_var00> changes to the word SEARCH. ·Note that this is exactly what I am using but it should get the point across.· Note also that you don't need the document.writeln section...I was using that to debug the variable information.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Post Edited (Chris Savage (Parallax)) : 6/20/2007 7:34:25 PM GMT
Paul
Doing it that way let’s you bring it right into the JavaScript variable…Nice and easy. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Doing it that way let’s you bring it right into the JavaScript variable…Nice and easy. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support