homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

"Error: uncaught exception" - in JavaScript...
Setting values from child window to parent's Elements.

 1:38 pm on May 27, 2003 (gmt 0)

I am setting some values from the child window to parent window's TextArea Element and sometimes getting this Error; not always. Can anybody help me in this? The detailed JavaScript Error is as below.

Error: uncaught exception: Permission denied to set property HTMLTextAreaElement.value

Please help me in this.

Thanx in advance.


Ajay Jadhav



 1:40 pm on May 27, 2003 (gmt 0)

Welcome to WebmasterWorld, ajayjadhav!

What is the code that is causing this error? If you could post a relevant snippet it may help!


 2:17 pm on May 27, 2003 (gmt 0)

ok. I'll post the code snippet now itself.


 9:49 am on Jun 2, 2003 (gmt 0)

This is the part of code, which raises an exception

>>Exception is :
Error: uncaught exception: Permission denied to set property HTMLInputElement.value

>>Code Snippet :

..... JSP code ....
..... JSP code ....

<script language="JavaScript">
//window.opener.document.form1.viewnotesTS.value = "<%= removeLineFeed(notes)%>"; // Gives exception..
//window.opener.updateNotes("<%= removeLineFeed(notes)%>"); // Gives exception..
window.opener.document.form1.hiddenNotes.value = "<%= removeLineFeed(notes)%>"; //Setting Hidden field..


 7:52 pm on Jul 3, 2003 (gmt 0)


Did you ever find a solution for this problem?

I have a similar thing happening. I am searching for an calling a function in another frame. I thought it was URL related as I spotted some problems with an embedded font in IE and it was sorted by ensuring every file has a <BASE href="..."> 'cos IE and NS were clipping my domain name from www.domainname.com to domainname.com.

This permission denied error is kind of intermittent. It doesn't happen when running off [localhost,...] but as soon as it's on a remote web server the problem happens.

On of the documents that calls the function in the other frame, actually creates a frameset through javascript document.write calls. This is the file that was stuffing up most of the time and repeatedly. I move the call to a script block after the closing </html> tag and the problem goes away. I now try and shift the calls around between the head, inside the body and after the body and then after the closing html tag until something is happy.

I don't like working like this. Does anyone know what causes these "uncaught exception: permission denied accessing..." errors?


 8:36 pm on Jul 3, 2003 (gmt 0)

All I know for sure is that it's part of the security steps taken in javascript -- but the details escape me. I'm glad the holes for obvious exploits are plugged, but sheesh!


 8:42 pm on Jul 3, 2003 (gmt 0)

Its probably a cross-domain security restriction. You can't fool with the documents in other windows from a different domain because potentially you could read things like CC numbers.


 11:38 pm on Jul 3, 2003 (gmt 0)

Doesn't explain why it works for some pages and not others 'cos I've made sure all of them definitely come up with the same complete domain name in their URL.

I'll keep trying different scenarios and ways of calling the function between windows, but there's no guarantee on a solution as I've thought I'd fixed the problem only for it to happen again after a short while.


 2:19 am on Jul 4, 2003 (gmt 0)

"sometimes getting this Error; not always"

Would suggest that the actual text content being assigned to the value of the textarea may be causing the problem.

//window.opener.document.form1.viewnotesTS.value = "<%= removeLineFeed(notes)%>"; //Raises exception

I assume removeLineFeed(notes) is a block of text with the LF characters stripped out.

Could it be the actual content of the text that's sometimes causing the error? Causing the syntax of the code to actually change?

To use the first line of this post as an example:

Window.opener.document.form1.viewnotesTS.value = ""sometimes getting this error; not always"";

It doesn't work. The double double quotes mess it up.

Could that be it?
It reminds me of the problem of writing text to a SQL database: Single quotes have a special meaning in SQL so they have to be escaped with an additional single quote which disappears when written to the database.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved