I need to send to the embedded device following command as GET
method but this value continuouspantiltmove: String(pt)
is not properly sent to the CGI
script via Google Chrome
, as a result it fails.
I cant fix it in CGI
script because its not managed by me as its an embedded device.
How can you submit it with iFrame
? or correctly via $.get
if iframe
is not possible.
When i open the URL simply in Google Chrome
URL then the CGI
script works, but not working with $.get
method.
function button_axisleft() {
if(alr>100) {
alr = 100;
}
if(alr<-100) {
alr = -100;
}
alr = alr - 1;
pt ="'" + alr + "," + aud + "'";
$.get('http://192.168.1.59/axis-cgi/com/ptz.cgi', {
camera: 1,
continuouspantiltmove: String(pt),
imagerotation: 0,
}, function(msg) {
console.log('OK');
});
}
EDIT: working version
// PAN-TILT-ZOOM
// No need to modify in CGI
function button_axisleft() {
if(alr>100) {
alr = 100;
}
if(alr<-100) {
alr = -100;
}
alr = alr - 1;
pt =alr + "," + aud;
$.get('http://192.168.1.59/axis-cgi/com/ptz.cgi?continuouspantiltmove=' + pt, {
camera: 1,
imagerotation: 0,
}, function(msg) {
console.log('OK');
});
}