David
David

Reputation:

iframe load failure again

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.

Upvotes: 1

Views: 1086

Answers (1)

Tolgahan Albayrak
Tolgahan Albayrak

Reputation: 3206

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

Upvotes: 1

Related Questions