I am using javascript to control an iframe on the page which loads content in the same domain because the page doing the manipulation. Actually within the iframe src I'm utilizing a relative path such as this:

<iframe id="myiframe" src="/foo/bar.html" .../>

The page shows within the iframe without problems, however when I attempt to gain access to the iframe using javascript, I recieve this error:

Permission refused for http://mysite.com to obtain property Window.document from http://www.mysite.com.

I understand http://www.mysite.com and http://mysite.com are thought different domain names no matter where they physically exist, but I have never set up almost anything to make use of the www. subdomain. And So I have no clue in which the www part is originating from. My best guess is the fact that I have to change something during my vhosts configuration. I am using Apache 2 and I've got a quite simple virtual host config file:

<VirtualHost *>
    ServerName mysite.com
    DocumentRoot /path/to/mysite.com/www

Any ideas?

"www.mysite.com" != "mysite.com"

mix frame/window communication must be on a single protocol+hostname+port