Sorry if I'm posting this code fence wrong. I am a senior citizen (noob) writing my first html.
I am writing a short script to control a ptz ip cam (192.168.1.247) for my raspberry pi.
The ptzLeftSubmit() and ptzRightSubmit() both work when I hit the buttons that call them.
The ptzloc1 and ptzloc2 do not work when I hit them.
The ptzloc1 and ptzloc2 html param.cgi call works in my browser window but not when I push the button.
Am I not allowed to pass the cmd parameter in a script? What am I doing wrong with ptzloc1 ptzloc2 etc?
function ptzLeftSubmit()
{
form1.action="http://192.168.1.247/web/cgi-bin/hi3510/ytleft.cgi";
form1.submit();
}
function ptzRightSubmit()
{
form1.action="http://192.168.1.247/web/cgi-bin/hi3510/ytright.cgi";
form1.submit();
}
function ptzloc1()
{
form1.action="http://192.168.1.247/web/cgi-bin/hi3510/param.cgi?cmd=preset&-act=goto&-status=1&-number=0";
form1.submit();
}
function ptzloc2()
{
form1.action="http://192.168.1.247/web/cgi-bin/hi3510/param.cgi?cmd=preset&-act=goto&-status=1&-number=1";
form1.submit();
#then later I do this
<body onLoad="load()">
<form name="form1" method="get" target="test">
</form>
<div style = "position:absolute; left:80px; top:20px;">
<p>
<input type="button"; value="∧" name="B3" onClick="ptzUpSubmit()">
<input type="button" ; value="∨" name="B2" onClick="ptzDownSubmit()">
<input type="button" ; value="<" name="B1" onClick="ptzLeftSubmit()">
<input type="button" ; value=">" name="B0" onClick="ptzRightSubmit()">
<button type="button" ; name="B4" onClick="location.reload()"><script type="text/javascript">document.write("REFRESH");</script></button>
</p>
</div>
<div style = "position:absolute; left:400px; top:20px;">
<p>
<input type="button"; value="1" name="B4" onClick="ptzloc1()">
<input type="button"; value="2" name="B5" onClick="ptzloc2()">
#etc....
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…