linking PINK variable to html variable
Posted: Mon Apr 08, 2013 9:20 am
Hi All,
I am trying to update the PINK's webpage using javascript.
I have tried all sorts of different ways to assign the value of Nb_var01 to my external variable (client-side variable?).
I'm an absolute noob so please be patient. Thanks
Here is my script (see line 4 in particular):
<p id="demo"></p>
<script>
var x="";
var time='<%=Nb_var01%>';
if (time==1)
{
x="Light is ON";
}
else if (time==0)
{
x="Light is OFF";
}
document.getElementById("demo").innerHTML=x;
</script>
I am trying to update the PINK's webpage using javascript.
I have tried all sorts of different ways to assign the value of Nb_var01 to my external variable (client-side variable?).
I'm an absolute noob so please be patient. Thanks
Here is my script (see line 4 in particular):
<p id="demo"></p>
<script>
var x="";
var time='<%=Nb_var01%>';
if (time==1)
{
x="Light is ON";
}
else if (time==0)
{
x="Light is OFF";
}
document.getElementById("demo").innerHTML=x;
</script>