2013-04-29 3 views
0

스크립트의 일부를 새로 고치는 메타 태그가있는 PHP 스크립트가 있습니다 (IP의 연결 확인 중). 이 작업을 수행하는 동안 "연결 확인 중, 5/10 재시도"와 같은 상태 텍스트가 출력됩니다.메타 태그 새로 고침을 일시적으로 사용 중지/중지 하시겠습니까?

끝 부분에 중지 버튼을 추가 했으므로 필요한 경우 중간에 새로 고침 절차를 중단 할 수 있습니다. 문제는 전체 refresh-procedure가 아니라 현재의 "load"를 멈추는 것처럼 보인다는 것입니다.

새로 고침을 일시적으로 사용 중지/중지 할 수있는 방법은 무엇입니까?

은 PHP 스크립트에서 코드입니다 :

function htmlheader() 
{ 
global $device, $frame, $tries, $maxtries, $status, $pageurl, $timeout; 
// global "custom" header settings 
$content = "<TITLE>PHP WoL ($device) - by PRThomasUK </TITLE>\n"; 
//generate refresh header for frame2. 
if ($status == 0) { 
$content .= "<META HTTP-EQUIV=\"refresh\" CONTENT=\"$timeout;url=$pageurl?&tries=$tries\">\n"; 
} 
return $content; 
} 
// function htmlheader() - Returns HTML content for mainpage, frame1 & frame2 based on value of $frame. 
function htmlcontent() 
{ 
global $pageurl, $device, $deviceip, $deviceport, $devicemac1, $devicemac2, $frame, $tries, $maxtries, $status; 
if ($frame == 1) { 
if ($status == 0) { 
$content = "<script type=\"text/javascript\">function stopFrameload() { window.stop(); document.execCommand(\"Stop\");}</script>\n"; 
$content .= "<p>Checking connectivity... ($tries/$maxtries) &nbsp;&nbsp;&nbsp<a href=\"\" onclick=\"stopFrameLoad(); return false;\">Stop</a></p>\n"; 
} 

이있는 JS 절연 :

<script type="text/javascript"> 
function stopFrameload() { 
window.stop(); 
document.execCommand("Stop"); 
} 
</script> 

을 그리고 실제 라인 출력 먹으 렴 :

<p>Checking connectivity... ($tries/$maxtries) &nbsp;&nbsp;&nbsp<a href="" onclick="stopFrameLoad(); return false;">Stop</a></p> 

답변

2

을 새로 고침을 일시적으로 사용 중지/중지하도록하려면 어떻게해야합니까?

먼저 META 태그를 출력하지 않으면.

관련 문제