0
Hello,
I’m trying to make a request but it’s not bringing the data
script js.
$.ajax({
url : "https://dwconsorcios.com.br/api/v1/contemplados",
type : "GET",
dataType:"json",
success:function (data) {
console.log(data);
$("#codImovel").val(data.id);
},
error:function(erro){
console.log(erro);
}
});
});
index.html
<body>
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script language="JavaScript" type="text/javascript" src="public_contemplados/script.js"></script>
<output id="codImovel"></output>
<output name="codImovel"></output>
</body>
GET, or POST? in question speaks post but in code is get
– Bernardo Lopes
is GET, adjusted the question
– Andre Miranda - XService
Ran on the server?
– Bernardo Lopes
yes was given run
– Andre Miranda - XService
and what returns? any error? already looked in the nvaegador tools if there is any message?
– Ricardo Pontual
shows this error 'Access to Xmlhttprequest at 'https://dwconsorcios.com.br/api/v1/contemplados' from origin 'https://ymove.com.br' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested Resource.'
– Andre Miranda - XService