Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Learn More

history forward is don't work in firefox?

  • 2 svar
  • 3 har detta problem
  • 11 visningar
  • Senaste svar av 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.

Ändrad av cor-el

Alla svar (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.