• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1102
  • Last Modified:

Uncaught Exception in FireFox (Permission Denied)

I have a website written using C# in asp.net 2.0.  One of the pages opens a pop-up which allows the user to select a value; the pop-up then writes a value to a hidden field on the parent page and closes itself.  In FireFox I get the following error :

uncaught exception: Permission denied to get property HTMLDocument.getElementById

Having read about a bit for an answer, the common solution seemed to be to do with cross-site scripting - however, both the parent page and the pop-up are in exactly the same domain.  The protocol is the same (both HTTP) and the sub-domain is the same, (www).

Here is the code I use in the pop-up :

<a href="
 ">Click Me</a>

As you can see it sets a few ID values and makes a DIV visible.

I have also tried this in IE7 and get "Access Denied".  I'm pretty sure this worked in IE6.
  • 4
  • 3
1 Solution
Does the element you are addressing actualy have an attribute called "id".

It sometimes happens that people only include a "name" attribute forgetting about the id attribute.


<div name="divname" id="divname">content</div>
wilsonrxAuthor Commented:
Hi Norush

The two elements in the parent page are as follows :

<img id="cbImgThumb" src="" style="display:none" />
<input name="ctl00$cphMain$txtImageId" type="text" id="ctl00_cphMain_txtImageId" class="hiddenfield" />

I have tried the situation with the following attached files. (rename them to .htm)

I got no problems. Even if i set security to medium-high in IE 7.

I dont know of any solition other than putting them in the same domain which you already did.

I'm sorry wilsonrx
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

wilsonrxAuthor Commented:
You're quite right, Norush.  I have tried both of your pages and they work fine so there must be something else going on here.  Oh well, back to the drawing board.
Good luck and let us know an result !
wilsonrxAuthor Commented:
Well, its totally bizarre.  I stripped out all of those javascript commands and added them back in one-by-one to see which was causing me problems.

Lo and behold it worked.

Not only that but when I compare the original and the fixed one - they are the same.

So this is fixed, thanks for your help - but I have no idea how I fixed it!
Yeah those thing do happen sometimes. Fixing something by doing exactly the same as before :)

Anyhow good luck !

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now