Launch function on a web server
criss87
Posts: 32
Hi guys,
I need a small help,
On a IP power switcher, I need to fire 2 function present in the HTML code of it's web server, can this be possible from Netlinx ? if possible I would like to don't use duet.
Thanks,
Criss
this are the function and attached the complete source code
function GetGroupOn()
{
var s = '';
var i = 1;
//for(var i = 1; i < 3; i++)
for(var j = 1; j < 9; j++)
{
if( document.getElementById('C'+ i + j).checked )
s += 1;
else
s += 0;
}
s += "00000000" + "00000000";
if(confirm("turn on the outlet"))
newAJAXCommand('ons.cgi?led='+s, null, false);
}
function GetGroupOff()
{
var s = '';
var i = 1;
//for(var i = 1; i < 3; i++)
for(var j = 1; j < 9; j++)
{
if( document.getElementById('C'+ i + j).checked )
s += 1;
else
s += 0;
}
s += "00000000" + "00000000";
if(confirm("turn off the outlet"))
newAJAXCommand('offs.cgi?led='+s, null, false);
}
I need a small help,
On a IP power switcher, I need to fire 2 function present in the HTML code of it's web server, can this be possible from Netlinx ? if possible I would like to don't use duet.
Thanks,
Criss
this are the function and attached the complete source code
function GetGroupOn()
{
var s = '';
var i = 1;
//for(var i = 1; i < 3; i++)
for(var j = 1; j < 9; j++)
{
if( document.getElementById('C'+ i + j).checked )
s += 1;
else
s += 0;
}
s += "00000000" + "00000000";
if(confirm("turn on the outlet"))
newAJAXCommand('ons.cgi?led='+s, null, false);
}
function GetGroupOff()
{
var s = '';
var i = 1;
//for(var i = 1; i < 3; i++)
for(var j = 1; j < 9; j++)
{
if( document.getElementById('C'+ i + j).checked )
s += 1;
else
s += 0;
}
s += "00000000" + "00000000";
if(confirm("turn off the outlet"))
newAJAXCommand('offs.cgi?led='+s, null, false);
}
0
Comments
There are other threads that talk about creating GET requests to web servers.
Jeff