Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

Why is my ptzloc1 button below not working?

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="&and;" name="B3" onClick="ptzUpSubmit()"> 
<input type="button" ; value="&or;" name="B2" onClick="ptzDownSubmit()"> 
<input type="button" ; value="&lt;" name="B1" onClick="ptzLeftSubmit()"> 
<input type="button" ; value="&gt;" 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="&#49;" name="B4" onClick="ptzloc1()"> 
<input type="button"; value="&#50;" name="B5" onClick="ptzloc2()"> 

#etc....


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...