저는 PHP 스크립트가 실행되는 동안 ajax 스크립트를 사용하여 iframe에 로딩 애니메이션을 표시하고 있습니다. PHP 스크립트가 실행되면 Ajax 로딩 스크립트가 완성 된 PHP 스크립트 출력을로드합니다.Ajax iframe 요청은 Internet Explorer에서 한 번만 작동합니다.
업데이트 : 대체하여이 문제를 해결 한 :
url='action.php?run=go';
http.open("GET",url, true);
로 :
http.open("GET", "go.php?random=" + Math.random(), true);
나는 IE가 각 요청을 캐시하고 두 번 이상 요청을 전송 좋아하지 않는 것을 읽어 보시기 바랍니다.
<!DOCTYPE html>
<script type="text/javascript">
document.write('<link rel="stylesheet" href="../css/loading.css" type="text/css" /><div id="loading"><br><center>Please Wait...<br><br><img src="loader.gif"/><center></div>');
//Ajax Function
function getHTTPObject() {
var xmlhttp;
if (window.ActiveXObject) {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
} else {
xmlhttp = false;
}
if (window.XMLHttpRequest) {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
}
//HTTP Objects..
var http = getHTTPObject();
//Function which we are calling...
function AjaxFunction() {
url = 'action.php?run=go';
http.open("GET", url, true);
http.onreadystatechange = function() {
if (http.readyState == 4) {
//Change the text when result comes.....
document.getElementById("loading").innerHTML = http.responseText;
}
}
http.send(null);
}
</script>
</head>
<body onload="AjaxFunction()">
</body>
버튼 코드와 관련된 자세한 정보를 제공해주십시오. – fvgs