1

I have a question similar to that posed in the Detect failure to load contents of an iframe issue. I am putting together a web page that loads a Google calendar as an iframe. I know that a large number of the computers that will use my web page will have restricted internet access such that the Google calendar won't load into the iframe. I would like to put a "timer" into my page that stops trying to load the Google calendar after a set amount of time or attempts and instead loads a local page that says the calendar can't be accessed.

I have been trying to use the checkForContents() function described previously, but I have now realized that I can't get any of the object properties from the Google site. In other words, document.getElementById(iframe).contentWindow.document returns nothing (or at least nothing useful) and the function fails silently but totally. I can instead use document.getElementById(iframe).contentWindow which simply returns "[object Window]" (and I don't seem to be smart enough to do anything useful with that).

Any thoughts? Thanks.

Community
  • 1
  • 1

1 Answers1

1

reasons of security sandbox, you can not reach or modify any content if the domains are different

Tolgahan Albayrak
  • 3,118
  • 1
  • 25
  • 28
  • I understand the issue of different domains. I'm looking for some way to solve the fundamental problem of testing that the frame hasn't loaded. –  May 20 '09 at 17:16
  • well use innerHTML to load a iframe : div.innerHTML = "" maybe this helps – Tolgahan Albayrak May 20 '09 at 18:39
  • Thanks. I'll give it a shot. But not today - other things are more pressing. –  May 20 '09 at 19:20