|
|
Q94 Why do I get an error message when trying to find the location of the document in the parent or sibling frame from another frame?
irt.org | Knowledge Base | JavaScript | Frame | Q94 [ previous next ] Q94 Why do I get an error message when trying to find the location of the document in the parent or sibling frame from another frame?Accessing the properties of the frame only works if the page loaded in that frame is on the same server as the document accessing that frame. As soon as the frame contains a page from another server you'll get the following JavaScript alert: Access disallowed at http://www.somewhere.com/page1.html to documents at http://www.somewhereelse.com/page2.htm You've hit what's called 'Tainting'. Its a security restriction. There's nothing you can do about external pages. However, if you just want to track your own pages, then you could do it in reverse. Instead of your frame checking the contents of the unknown frame, you could swap it around so that the unknown frame tells your frame what it contains whilst its loading. In the parent document:
In the your.html document:
And in the unknown.html document:
|
-- div -->
|