Odd behavior from iframe in IE8 on XP

Hey guys

My dad threw this issue at me. He’s developing a site using ASP.NET, which uses an iframe to display sub-pages.

Basically, the master page uses JS to adjust the iframes height, and the contentpage inside the iframe calls said JS with whatever height it has.

This works, as long as we’re on the same domain. We know this won’t work when we load pages from another domain inside the same iframe.

However, when we load an external page, and then switch the location back to a page on the same domain as before, the JS connection breaks.

This ONLY happens on windows XP using IE8.

Imagine this:

  1. Index.asp loads relative page “Pages/randompage.asp” in iframe “ContentFrame”.

  2. randompage.asp can call a method residing in Index.asp, no problems here.

  3. A link inside randompage.asp refers to an external page http://www.randomsite.com/randompageexternal.html.

  4. randompageexternal.html has a link that refers back to randompage.asp, but has to do it using a complete URL: http://www.oursite.com/Pages/randompage.asp.

  5. randompage.asp is now loaded in the same frame as before, and we’re on the correct domain again. Only this time, calling the same method as before causes an “Access denied”.

WTF?