2
I am trying to make a connection in datasnap using ajax
my code:
var url = 'http://cloud.nooven.com.br:12345/datasnap/rest/TServerMethods1/CriaSessao/'+cpfCnpj+'|'+usuario+'|'+senha;
console.log(url);
$.ajax({
type: "GET",
url: url,
dataType: "json",
success: function(data){
console.log('sucesso');
},
error: function(data){
console.log('erro');
}
});
the page .html
that I’m accessing on the server, so it’s like localhost on the variable url
, the error that occurs is this:
XMLHttpRequest cannot load http://cloud.nooven.com.br:12345/datasnap/rest/TServerMethods1/CriaSessao/68243096000152%7CMOACIR%7C123456. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://cloud.nooven.com.br' is therefore not allowed access. The response had HTTP status code 503.
thank you.
where I’m using @Guilhermenascimento ???
– Furlan
ah, I just used, no big deal, I switched from jsonp to json and changed the error: 'Xmlhttprequest cannot load http://cloud.nooven.com.br:12345/datasnap/Rest/Tservermethods1/Creationsare/68243096000152%7CMOACIR%7C123456. No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'http://cloud.nooven.com.br' is therefore not allowed access. The Response had HTTP status code 503. '
– Furlan
in php, I solved with header( "Allow - ......
– Furlan
yes, a lodging of mine
– Furlan
the code is in Delphi, is a datasnap
– Furlan
I usually solve like this: https://answall.com/questions/92269/qual-%C3%A9-o-nome-opera%C3%A7%C3%A3o-quando-fazemos-uma-requisi%C3%A7%C3%A3o-ajax-para-o-servidor-int
– Wallace Maxters