Forum Moderators: open

Message Too Old, No Replies

Iframe problem

         

akswithsim

8:42 am on Apr 21, 2007 (gmt 0)

10+ Year Member



I am using iframe structure as shown below
Main Window
----IFrame 1 (inside main window)
--------Iframe 2 (inside Iframe1)
----------------Iframe 3 (inside Iframe2)

From Iframe2, to call Iframe3 I am using following code
---------------
var obj = window.frames["Iframe3"];
---------------
Above code is throwing error in IE: Permission Denied.
but working fine in Firefox.

Can anybody help me. Its urgent?
Thanks in advance

akswithsim

9:52 am on Apr 21, 2007 (gmt 0)

10+ Year Member



Errors:
in IE 6 - Permission Denied.
in IE 7 - Object Expected.
in Firefox - Working fine.

One more infomation :
I am using Iframe SRC of same domain. (not external link is there).

Dabrowski

12:55 pm on Apr 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Strange one, permission denied should only happen if it's a different domain, which you've said it's not.

Object expected would seem that it can't find the objcet at all. Just a thought, I don't know how case sensitive IE is, try the IFRAME names in lower case. I'll do a test page for this and see if I can get it to work.

akswithsim

6:13 am on Apr 23, 2007 (gmt 0)

10+ Year Member



thanks Dabrowski for your replay. problem solved, just by reloading the window. But don't know why it is happening?

Dabrowski

8:51 am on Apr 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmmm, maybe it's to do with load times, IE might not let you access the IFRAME until it's loaded.

Try doing this:

function checkFrame() {

if(!frames['Iframe3']) {
alert( "Not ready yet!");
setTimeout( "checkFrame();", 100);
return;
}

myIframe = frames['Iframe3'];
}

That should keep trying every 100ms until the frame object actually exists.