leclaude
asked on
Permission Denied when accessing parent from child window
Hi,
I have a window that uses Javascript to add rows to an HTML table on its parent window. That works fine and I then press 'save' on the parent window to commit it to the database and refresh the screen with the new data.
However, when I again try to access the parent window's element from the child's (even just referencing some component), I get a Permission Denied javascript error. It seems like when the parent window refreshes, the image of its contents changes (although the content are the same). For example, trying table.addRow, deleteRow, or even referencing table.rows.length, cause the error. Both windows are in the same domain so cross-site scripting restrictions shouldn't be an issue. I'm using ie7.
Is there a way for the child window to reference the parent after the parent refresh, or is there another issue involved?
Thanks
I have a window that uses Javascript to add rows to an HTML table on its parent window. That works fine and I then press 'save' on the parent window to commit it to the database and refresh the screen with the new data.
However, when I again try to access the parent window's element from the child's (even just referencing some component), I get a Permission Denied javascript error. It seems like when the parent window refreshes, the image of its contents changes (although the content are the same). For example, trying table.addRow, deleteRow, or even referencing table.rows.length, cause the error. Both windows are in the same domain so cross-site scripting restrictions shouldn't be an issue. I'm using ie7.
Is there a way for the child window to reference the parent after the parent refresh, or is there another issue involved?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was actually able to fix this. I was setting the variable that held the parent element items to null if the element wasn't found. Instead I need to re-reference it when the page refreshes and that fixed the problem.
Glad you sorted it out. You can select your own comment as answer, or select your own comment as answer and give some points for the effort the expert(s) have invested in helping you... ;)
This is one of those security cases where the good guys suffer from the behavior of the bad guys. But other then instructing your users to lower their security, or to close and reopen your child window, you cannot do much I'm afraid.