I would like to create a button in a Template Node which sends a GET method (to turn the camera to a predefined position).
For the curious it looks like that
Here is the html code for the N°2 button :
<button id="preset_1" width="10px" eight="10px" type="button">2</button>
<script>
// Add your Javascript here, between the 'script' tags ...
$(document).ready(function() {
// As soon as the document is loaded, add a click event handler to your preset button
$("#preset_1").click(function(e) {
e.preventDefault();
$.ajax({type: "GET", url: "http://user:pass@192.168.1.8/web/cgi-bin/hi3510/param.cgi?cmd=preset&-act=goto&-status=1&-number=2",
});
});
});
</script>
When I have more time and experience, as proposed@andreiI could study the Fetch API
But meanwhile, the only thing that I found that works but is not at all sexy, is the use of the <form> tag with which I can access my request, without security alert:
<form action = "http://user:pass@192.168.1.8/web/cgi-bin/hi3510/param.cgi?" target = "_ blanc" method = "GET">
<input type = "text" name = "cmd" value = "preset">
<input type = "text" name = "- act" value = "goto">
<input type = "text" name = "- status" value = "1">
<input type = "text" name = "- number" value = "1">
<input type = "submit" value = "Go!">
</form>