Google Docs viewer returning 204 responses, no longer working, alternatives?

后端 未结 7 1910
执念已碎
执念已碎 2020-12-08 01:01

UPDATE 2016-11-16 9:53am EST

It appears many people are still seeing 204 responses even though Google has claimed to have \"fixed\" the problem. Wh

7条回答
  •  攒了一身酷
    2020-12-08 01:38

    I solved this problem as follows. If google viewer is not loaded, make iframe restart.

    function reloadIFrame() {
    var iframe = document.getElementById("iFrame");
      console.log(frame.contentDocument.URL); //work control
      if(iframe.contentDocument.URL == "about:blank"){
        iframe.src =  iframe.src;
      }
    }
    var timerId = setInterval("reloadIFrame();", 2000);
    
    $( document ).ready(function() {
        $('#menuiFrame').on('load', function() {
            clearInterval(timerId);
            console.log("Finally Loaded"); //work control
        });
    });
    
    

提交回复
热议问题