1

Is it possible to detect if a document loaded by an iframe exists or not? The difficulty is, that the iframe document is from another domain than the parent page.

Anything that tells me if the iFrame page exists could be used, such as document title or response status code.

At the end of the day I want to see if the page of the iframe was found or not (timeout or 404).

Has someone a clue?

Erik
  • 11,944
  • 18
  • 87
  • 126
  • 1
    http://stackoverflow.com/questions/4548984/detect-if-the-iframe-content-has-loaded-successfully – Cheery Jan 27 '12 at 08:36

1 Answers1

3

That's impossible to achieve with javascript if the site is not on your domain. You have no scripting access whatsoever to it. You might perform this check on your server by sending a request to the remote site beforehand and see what it responds. Surely it does an additional request but that's the only way unless of course you don't want to install some plugins on the client browser.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928