Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

history forward is don't work in firefox?

  • 2 답장
  • 3 이 문제를 만남
  • 1 보기
  • 최종 답변자: ellvas

more options

code:

var gads= function (id, config, src) {

   var iframe, body = document.body;
   if (document.createElement) {
       var iframe = document.createElement("IFRAME");
       if (iframe) {

           //set iframe domain consistent with the web page
           iframe.src = 'javascript:void((function(){var d=document;d.open();d.domain="webdomain.com";d.write("");d.close()})())';
           iframe.id = id;
           iframe.width = "1px";
           iframe.height = "1px";
           iframe.style.display = "none"
       }
   }
   if (body != null && body.appendChild && iframe) {
       body.appendChild(iframe);

       gads[id] = setInterval(function () {
           try {
               if (gads[id]) {
                   clearInterval(gads[id])
               }
               var iframeEle = document.getElementById(id),
                      iframeEleDoc = iframeEle.contentWindow.document;
               
               alert(1);    
               // dosomething in script
               iframeEleDoc.write('<!doctype html><ht'+'ml><bo'+'dy><scr'+'ipt>alert(2);</scr'+'ipt></bo'+'dy></ht'+'ml>');
               //run to here,  history forward is don't work.
               alert(3);
               window.setTimeout((function () {
                   iframeEleDoc.close()
               }), 0)
           } catch (e) {
               alert(e)
           }
       }, 100)
   }

}; 

run to the "alert (1)", history forward showed normal, but run to the "alert (3)" when history forward display abnormal. where is the forward? And this phenomenon occurs only in firefox, other browsers have shown normal.

code: <pre><nowiki>var gads= function (id, config, src) { var iframe, body = document.body; if (document.createElement) { var iframe = document.createElement("IFRAME"); if (iframe) { //set iframe domain consistent with the web page iframe.src = 'javascript:void((function(){var d=document;d.open();d.domain="webdomain.com";d.write("");d.close()})())'; iframe.id = id; iframe.width = "1px"; iframe.height = "1px"; iframe.style.display = "none" } } if (body != null && body.appendChild && iframe) { body.appendChild(iframe); gads[id] = setInterval(function () { try { if (gads[id]) { clearInterval(gads[id]) } var iframeEle = document.getElementById(id), iframeEleDoc = iframeEle.contentWindow.document; alert(1); // dosomething in script iframeEleDoc.write('<!doctype html><ht'+'ml><bo'+'dy><scr'+'ipt>alert(2);</scr'+'ipt></bo'+'dy></ht'+'ml>'); //run to here, history forward is don't work. alert(3); window.setTimeout((function () { iframeEleDoc.close() }), 0) } catch (e) { alert(e) } }, 100) } }; </nowiki></pre> run to the "alert (1)", history forward showed normal, but run to the "alert (3)" when history forward display abnormal. where is the forward? And this phenomenon occurs only in firefox, other browsers have shown normal.

글쓴이 cor-el 수정일시

모든 댓글 (2)

more options

A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the MozillaZine forum site in order to post at that forum.

more options

ok. Thanks.