The browser will prevent this, because the domains are different.
There are a couple of tricks you can use to communicate between frames:
- Add a DNS record for the other website to the outer website's domain (www.somewebsite.com and someapp.somewebsite.com). Then use document.domain = "somewebsite.com" in both pages' JavaScript.
- Use HTML 5 postMessage() to communicate between frames. I know it works in Firefox 3 and Internet Explorer 8, but not in IE7.
- You can pass simple messages to another page by setting the parent window's URL.
Note: It appears browsers prevent setting of the parent URL. This method will this only work for one-way communication from parent to child frame.
Ad 3:
You won't be able to read the other frame's URL, but you can set it. If you change the URL to the exact same page, but with an #anchor component to the URL, the page will not actually reload:
window.frames["childFrame"].location.href = "http://www.somewebsite.com/#message"
You'd then need to add a script to the outer page that regularly polls it's location.href and process the messages. Yes, it's ugly, but if done right, it will work in all common browsers.