JS error: "Permission denied to get property HTMLDocument.window" in Firefox 1.0.6

J

John Mack

Intermittently I get the following error on Firefox:

"Error: uncaught exception: Permission denied to get property
HTMLDocument.window"

What can cause this error? I do an image switch via JS just before
redirecting the page (also via JS), could this be the problem - not
giving enough time to do the image switch before redirecting?

Pieces of the page I created that generated this error are below. The
page basically swaps an image on the page with a new one when a user
clicks on a link before the link is followed.

<script>
function userSelectedChoice() {
var pickIMG = "";
pickIMG = new Image();

if (document.images){
pickIMG.src = "choice1.gif";
document.images.manualpick.src = pickIMG.src;
}
this.location = someURL;
}
<script>
<body>
{user clicks on an <a href="javascript:userSelectedChoice()...>, the
above JS
gets executed, the <img> below is swapped out before page reloads}

<img src="default.gif" alt="-" name="manualpick" id="manualpick">

</body>
 
M

Martin Honnen

John said:
Intermittently I get the following error on Firefox:

"Error: uncaught exception: Permission denied to get property
HTMLDocument.window"

Does the console not tell you the line that causes the error?

{user clicks on an <a href="javascript:userSelectedChoice()...>,

Code that as
<a href="#"
onclick="userSelectedChoice(); return false;">
to see whether that improves things.
 
J

John Mack

My replies:
Q: "Does the console not tell you the line that causes the error?"
A: No, using the Firefox JS console I do not get a line number.
Haven't seen an error at all yet in IE 6 or Opera 7.53

Testing with your suggestion...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top