window.frames[0].document

K

Kannan Ekanath

Hi,
I would like to know why at times the following code
window.frames['some name'].document throws an Access Denied error.

I have a button which submits a form in an iframe I need some things
to happen in the parent page. However, on say the 3rd or 4th resubmit
of the page, I am getting this Access Denied error. The first 3
submission somehow seems to be fine.

Can someone let me know, what could be the issue here? It happens only
in IE and not in firefox.

Thanks,
Kannan
 
M

Martin Honnen

Kannan said:
I would like to know why at times the following code
window.frames['some name'].document throws an Access Denied error.

Your code is only allowed to access the document from the same origin as
the main document.
 
K

Kannan Ekanath

I would agree to that, However here is my situation,

I have a page with an iframe and inside the iframe i have form submit
events, during all form submissions I execute the same code, this
access denied happens only in the 4th form submission. I have tried
everythign there is no difference between first and second form
submission, in fact I always press the same button. Also fact
window.frames['some name'] here refers to the same frame on which am
submitting the frame. However that piece of code is written in my
javascript library which tracks iframes open in the window.

Can you also tell me if there are any work arounds on this?



Kannan said:
I would like to know why at times the following code
window.frames['some name'].document throws an Access Denied error.

Your code is only allowed to access the document from the same origin as
the main document.
 

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
474,159
Messages
2,570,879
Members
47,414
Latest member
GayleWedel

Latest Threads

Top