1
_setPrintExportCookieInterval: function(/**String*/requestId, /**function*/closePopup) {
//have the interval autoexpire after some amount of seconds
var count = 0;
var intervalMs = 2000;
var intervalId = self.setInterval(function() {
var reportCookie = dojo.cookie(requestId);
console.debug('requestId ' + requestId);
if(reportCookie || count > 300000) { //5 mins
//if there's a status failure, don't close the window
console.debug('reportCookie ' + reportCookie);
if(reportCookie == undefined){
console.debug("print/export request returned with undefined status ");
} else if(reportCookie == "success") {
closePopup();
} else{
console.debug("print/export request returned with nonstandard status " + reportCookie);
}
window.clearInterval(intervalId);
//delete the cookie
dojo.cookie(requestId, null, {path: "/", expires: -1});
//destroy the iframe
//dojo.destroy(dojo.byId(requestId));
};
count+=intervalMs;
}, intervalMs);
return intervalId;
},
위의 javascript 기능에 문제가 있습니다.dojo.cookie (id)가 간헐적으로 id로 쿠키를 찾을 수 없습니다.
var reportCookie = dojo.cookie(requestId);
반환 null
,하지만 난 내 브라우저의 디버깅 도구에서 볼 때 나는 쿠키 success
의 값이 존재하는 것을 볼 수 있어요 :이 문제는 일반적으로 때로는이다. 이것은이 함수가 호출 될 때마다 10 번 발생합니다. 어떤 아이디어가 dojo.cookie()
일 때만 ID로 쿠키를 검색 할 수없는 이유는 무엇입니까?
나를 위해 일했다. – kaze