Firefox Error: Permission denied to get property HTMLDocument.location

20 October 2007

I just came across an error in one of my sites that uses JavaScript to change what is displayed in an iframe when the user hits a button. Anyway, my original code looked like

document.iframe.location=’url to be displayed’;

This works fine in explorer but Firefox’s error console kept coming up with; “uncaught exception: Permission denied to get property HTMLDocument.location”. After a little searching I found the solution.

parent.iframe.location.href=’url to be displayed’;

If you run across this same error I hope this helps.