home go links go books go opinion go gallery go projects go resumé go
about this site
archives
book reviews
"to read" list
tech books
search books
books archive
last 10 posts
quotes
cluetrain
cluetrain (mirrored)
randobracket
image auth
search engine hits
  hit history
indexer stats
user agent list
HTML (view)
  (most up-to-date)
MS Word (dl)
code examples
doesntsuck.com
doesntsuck.com

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.

Posted by yargevad at June 14, 2005 03:23 PM


This weblog is licensed under a Creative Commons License.