...

View Full Version : external site via an iframe



rlemon
05-30-2006, 04:36 PM
Hey All,
I'm attempting to talk to an external site via an iframe and i'm running into problems.

The site i'm attempting to talk to is on my local network, and i do have permissions to access it so there is no security risk involved.

My problem is accessing a javascript call on a framed page that exists in my iframe.

Example:

Document
> Iframe
> Document
>Frameset (named 'top')
>Frameset (named 'content')

I want to talk to content and execute a javascript call.

I've attempted document.frames['iframe'].frames['content'].javaScriptCall()
and all other veriations of called a frame/object i can think of. Is there anything i could possibly try or am obviously missing to do this?

Other examples (there were MANY):
document.getElementById('iframe').frames[1].call();
document.getElementById('iframe').document.frames['content'].call();

Beagle
05-30-2006, 05:17 PM
are you sure that:
frames['iframe'].frames exists?

I'm not sure myself, and I don't have time to test it, but try alerting each step of your reference chain: alert(document.frames['iframe']); alert(document.frames['iframe'].frames);, etc. and see if you get a null reference.

rlemon
05-30-2006, 05:27 PM
document.frames['iframe'].frames is not null but returns a length of 1

Beagle
05-30-2006, 05:31 PM
you could try a for (x in frames['iframe'].frames])

and alert what's in there.

Kor
05-30-2006, 05:31 PM
My problem is accessing a javascript call on a framed page that exists in my iframe.

document.getElementById('iframeid').contentWindow.frames['framename'].javaScriptCall()

should do the job, i guess

rlemon
05-30-2006, 06:52 PM
document.getElementById('iframeid').contentWindow.frames['framename'].javaScriptCall()

should do the job, i guess

thanks:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum