-1
나는 아약스 개발에 매우 익숙하다. xhr을 사용하여 데이터를 얻고 싶다. 문제는 포트 기반 요청을 사용할 때인가? 포트가 응답을 받고 없습니다 : 나는 URL을 네이티브 XHR을 사용하고 때xhr 특정 포트로 요청을 보내시겠습니까?
여기 내 작업 코드와 작동하지 않는 코드
$.ajax({
url : "login.php",
type : "post",
data : {
userProfile : JSON.stringify(data)
},
success : handleDBResponse,
error : function(jqXHR, textStatus,errorThrown) {
console.log("The following error occured: "+ textStatus,errorThrown);
},
complete : function() {
// console.log("user authentication
// successful.")
}
});
이 잘 작동하지만.
function reqListener() {
console.log(this.responseText);
};
var oReq = new XMLHttpRequest();
oReq.onload = reqListener;
oReq.open("get", "http://www.domain.com:443/akorp.css", true);
oReq.send();
작동하지 않아 디버깅되었으며 요청 상태가 취소 된 것으로 나타났습니다.
.htaccess
파일은 여전히 나는 무엇을이 오류의 원인은 무엇이며 어떻게 제대로 포트에 요청을 보낼 오류
www.domain.com:443 not allowed by www.domain.com Access-Control-Allow-Origin etc..
을 얻고있다
Access-Control-Allow-Origin:*
을 포함?
누군가의 서버가 아닙니다. 포트가있는 자체 서버 – user1834809