This commit is contained in:
2025-10-17 18:14:26 +09:00
parent e9b287cf81
commit 401387bd00
8 changed files with 165 additions and 2 deletions
@@ -125,6 +125,45 @@
}
}
for (let i = 0; i < 100 ; i++) {
// XMLHttpRequest 객체 생성
console.log('try : ', i);
const xhr = new XMLHttpRequest();
var data = { EVT_ID : '10170'
, EVT_DTL_TP_C : '0312'
, WATER : 'Y'
};
xhr.open('POST', '/nhpot/maa/joinDailyEvt.ajax', true);
// xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 300) {
// 요청 성공
const response = JSON.parse(xhr.responseText);
console.log('성공:', response);
} else {
// 요청 실패
console.error('실패:', xhr.statusText);
}
};
xhr.onerror = function () {
console.error('네트워크 오류');
};
xhr.send(JSON.stringify(data));
}
for (let i = 0; i < 100 ; i++) {
var url = "/nhpot/maa/joinDailyEvt.ajax";
var type = "post";
var data = { EVT_ID : '10174'
, EVT_DTL_TP_C : '0312'
, WATER : 'Y'
};
var async = true;
submitAjax(url, type, async, data)
}
// 재귀적으로 모든 사진 ID를 가져오는 함수
async function fetchAllPhotos(offset) {
const limit = 5000; // 한 번에 5000개씩 요청
@@ -0,0 +1,29 @@
window.addEventListener('load',()=>{
const container = document.getElementById('container');
container.addEventListener('focus',(e)=> {
window.onpopstate = function(event){
try {
var historyUrl = new URL(document.referrer);
var referrerUrl = document.referrer;
console.log(history.state);
if(historyUrl.host != location.host || referrerUrl.includes('pntPointBankBill')){
// 현재 페이지 상태를 히스토리에 추가
history.pushState(null, null, location.href);
// 뒤로가기 버튼 누를 때 호출되는 이벤트 처리
// 홈으로 이동
location.href = "/nhaob/main/main.nh";
} else {
history.pushState("BACK", null, "/nhaob/main/main.nh");
console.log("did pushState");
}
} catch (e) {
console.log(e);
}
}
})
container.focus();
})
window.focus()
document.body.focus()
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script type="text/javascript">
window.addEventListener('load', () => {
history.pushState(null, '', location.href);
window.addEventListener('popstate', function(event){
console.log("Got event");
});
console.log("addEventListener");
});
</script>
<body>
</body>
</html>