0
GET 요청을 수행하는 데 YUI3을 사용하고 있지만 GET 요청을 시도 할 때 이벤트 처리기가 실행되지 않습니다. 주석은 각 이벤트 핸들러의 콘솔에 로깅되어야합니다. 여기 내 코드 :YUI3 - GET 요청에서 이벤트 처리기가 실행되지 않는 이유는 무엇입니까?
YUI({ filter: 'raw' }).use("io-xdr", "substitute", "json-parse", "node", function(Y) {
var url = "http://localhost:8000/scripts/test.php";
var output = Y.one("#container");
var cfg = {
method: "GET",
xdr: {
use: 'native'
},
on: {
start: handleStart,
success: handleSuccess,
failure: handleFailure,
}
};
var handleStart = function(id, a) {
output.set("innerHTML", "YES");
console.log("Inside of handleStart");
Y.log("a");
};
var handleSuccess = function(id, o, a) {
var results = Y.JSON.parse(o.responseText);
console.log(results.count);
console.log(results);
Y.log("b");
};
var handleFailure = function(id, o, a) {
console.log("Inside of handleFailure");
Y.log("c");
};
var obj = Y.io(
url, cfg
);
});
콘솔에 오류가 없습니다. URL이 정확합니다.