Page is a not externally linkable
- Code, Content, and Presentation
-- HTML
---- External Frame Breaking


tedster - 10:46 pm on Dec 14, 2000 (gmt 0)


qianxing,

You are up against the "same origin" security restrictions written into JavaScript. Frame busting scripts are normally written into the code of the page that you want to make the top location. Imposing that kind of change through JavaScript code from a different server just won't happen -- if it could, all kinds of mischief might follow, such as reading properties of other windows behind firewalls and so on.

To access properties in this way, you need to use a signed script with UniversalBrowserRead privileges, and even then it wouldn't be automatic, but would require explicit permission every time it is accessed.

However, I assume you have some relationship to the domain that is framing the original document. If so, there are other ways to accomplish your purpose. The code on the page you want to take to the top can make its properties available to others through a user defined variable, i.e.

document.mylocation=document.location

Then your code can access the mylocation property without a security violation. I've never tried this myself, but this is the way it's supposed to work in theory.


Thread source:: http://www.webmasterworld.com/html/111.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com