I am using Html with JavaScript to execute the jobs in the server. Below code working fine in local desktop, but when I move this same code to remote desktop. Here I am getting 403 forbidden error.
Error - Failed to load https://FRQMAAK834:4993/api/login/ntml: The 'Access-Control-Allow-Origin' header has a value 'null' that is not equal to the supplied origin. origin 'null' is therefore not allowed access.
Need your suggestion.
<html>
<head>
</head>
<body>
<h1>Nprinting API task starter</h1>
<script src="jquery-1.10.1.min.js"></script>
<script type="text/javascript">
(function()
{
console.log("started")
var taskIDs=
[
"28b17059-3f0d-4844-83aa-0c0460f413bf"
]
var serverName=
[
"FRQMAAK834"
]
$.ajax({
url: 'httpS://'+serverName+':4993/api/v1/login/ntlm',
xhrFields: {
withCredentials: true
}
}).done(function(data) {
console.log(data);
for(var i=0;i<taskIDs.length;i++)
{
$.ajax
({
type: "POST",
url: 'httpS://'+serverName+':4993/api/v1/tasks/'+taskIDs[i]+'/executions',
xhrFields:
{
withCredentials: true
}
}).done
(function(data)
{
console.log("task "+i);
console.log(data);
}
);
}
});
})();
<!-- open(location, '_self').close(); -->
</script>
</body>