Maybe some of you could have ran into the same problem i did. Imagine you have a file on your machine: file:///c:\test.html
And you have an IFrame inside of this file. You need to indicate whether the IFrame contents are loaded or no.
Bacically, what we have here: 1. location, href, or any other property is inaccessible from file:/// to http:///, or backwards. 2. you can't fire event from the browser window in iframe, or in opposite direction, unfortunately.
Does this problem have a solution? P.S.: that's not a hack. it's a real problem. making some interaction from local machine with website integration.
UPD: I kinda figure out why it's forbidden. ANY interaction with local files should be forbidden from the web page. It's kinda cool, i do agree. But isn't a # hashtag something that can't harm anyone? :(
You may find some of these techniques useful: http://softwareas.com/cross-domain-communication-with-iframes
Edit: Per comments below, these techniques don't seem to work when accessing
file:///c:\<path>\test.html
, whereas they do when accessinghttp://localhost/test.html
.I think that's because the
file
protocol is even more restricted by the browser than thehttp
protocol. The MSDN page on the file protocol states:Whatever technique you were using to get some cross-domain communication was probably blocked by the browser because you were using the
file
protocol.