June 14, 2005
javascript "same origin" policy (link)
http://www.mozilla.org/projects/security/components/same-origin.html
I had this problem today that it took me longer than I expected to find a solution to. I'm working on a server that runs alongside a webserver and writes out javascript in iframes as subpages of pages served by the webserver. I dev primarily in mozilla on RH9 and I was getting errors like "Error: uncaught exception: Permission denied to get property Window.blah" when I would attempt to access the parent from the iframe. Turns out the solution was to set document.domain to the same thing as the server ('localhost') in the page that my server returns. Simple? Sure, but it took me a couple hours to diagnose and track down. Hopefully this will save someone some digging.