0

I have an iframe code that exports display grid as csv by calling html file called exporter.html. Right now, iframe is doing all the work at once which is causing unresponsiveness while exporting large data. I am trying to find a way to set timeouts in this iframe code so that the program becomes responsive while exporting large data. Can someone suggest some idea?

var iframe = document.createElement('iframe');
        iframe.id = "_hidden_iframe_exporter";
        iframe.style.display = "none";
        iframe.src = 'exporter.html?csv';
        iframe.hidden = true;
        document.body.appendChild(iframe);
norbeq
  • 2,923
  • 1
  • 16
  • 20
unhappy_vapor
  • 39
  • 1
  • 7

1 Answers1

0

Something like this found here?: iframe loading time limit use javascript

function setIframeSrc() {
  var iframe = document.createElement('iframe');
    iframe.id = "_hidden_iframe_exporter";
    iframe.style.display = "none";
    iframe.src = 'exporter.html?csv';
    iframe.hidden = true;
    document.body.appendChild(iframe);
  setTimeout(function(){
      if (window.stop) {
          window.stop();
      } else {
          document.execCommand('Stop'); // MSIE
      }
  }, 5000);
}
setTimeout(setIframeSrc, 5000);

Or am I misinterpreting what you are asking?

figbar
  • 714
  • 12
  • 35