467,915 Members | 1,582 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

Get IFRAME url

Hi.

I have a strange problem wuth IFRAME.

I have page aaa.aspx with an IFRAME that contain page bbb.aspx.

page bbb.aspx sometimes redirect him self to page ccc.aspx.

The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).

What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.

I know it complex but I really hope you can help me.

Thanks.

Jan 25 '07 #1
  • viewed: 6409
Share:
7 Replies
So using redirect could well perhaps change the document location but leave
src unchanged (after all you didn't tell the parent frame the location
should be changed).

So something that could work would be to get the document.location for this
document rather than using the src attribute of its parent frame.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@s48g2000cws.googlegroups.c om...
Hi.

I have a strange problem wuth IFRAME.

I have page aaa.aspx with an IFRAME that contain page bbb.aspx.

page bbb.aspx sometimes redirect him self to page ccc.aspx.

The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).

What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.

I know it complex but I really hope you can help me.

Thanks.

Jan 25 '07 #2
Hi Patrice,

Thanks for the reply.
The question is how can I get the location of the page inside the
IFRAME?

I didn't saw any way to get the location of the real document inside
the IFRAME?

Thanks.
Patrice כתב:
So using redirect could well perhaps change the document location but leave
src unchanged (after all you didn't tell the parent frame the location
should be changed).

So something that could work would be to get the document.location for this
document rather than using the src attribute of its parent frame.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@s48g2000cws.googlegroups.c om...
Hi.

I have a strange problem wuth IFRAME.

I have page aaa.aspx with an IFRAME that contain page bbb.aspx.

page bbb.aspx sometimes redirect him self to page ccc.aspx.

The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).

What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.

I know it complex but I really hope you can help me.

Thanks.
Jan 25 '07 #3
Try ifrm.document.location.href, ifrm being the ID of your IFRAME tag...

--
Patrice

"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@q2g2000cwa.googlegroups.c om...
Hi Patrice,

Thanks for the reply.
The question is how can I get the location of the page inside the
IFRAME?

I didn't saw any way to get the location of the real document inside
the IFRAME?

Thanks.
Patrice ???:
So using redirect could well perhaps change the document location but
leave
src unchanged (after all you didn't tell the parent frame the location
should be changed).

So something that could work would be to get the document.location for
this
document rather than using the src attribute of its parent frame.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@s48g2000cws.googlegroups.c om...
Hi.

I have a strange problem wuth IFRAME.

I have page aaa.aspx with an IFRAME that contain page bbb.aspx.

page bbb.aspx sometimes redirect him self to page ccc.aspx.

The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).

What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.

I know it complex but I really hope you can help me.

Thanks.

Jan 25 '07 #4
Damn, It look good for a moment :(

I tried it but in internet explorer it return me the url of the parent
page (aaa.aspx) and not bbb or ccc.

In fire fox nothing happen :(

any more ideas?

Thanks.

Patrice wrote:
Try ifrm.document.location.href, ifrm being the ID of your IFRAME tag...

--
Patrice

"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@q2g2000cwa.googlegroups.c om...
Hi Patrice,

Thanks for the reply.
The question is how can I get the location of the page inside the
IFRAME?

I didn't saw any way to get the location of the real document inside
the IFRAME?

Thanks.
Patrice ???:
So using redirect could well perhaps change the document location but
leave
src unchanged (after all you didn't tell the parent frame the location
should be changed).

So something that could work would be to get the document.location for
this
document rather than using the src attribute of its parent frame.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@s48g2000cws.googlegroups.c om...
Hi.
>
I have a strange problem wuth IFRAME.
>
I have page aaa.aspx with an IFRAME that contain page bbb.aspx.
>
page bbb.aspx sometimes redirect him self to page ccc.aspx.
>
The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).
>
What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.
>
I know it complex but I really hope you can help me.
>
Thanks.
>
Jan 25 '07 #5
Tried it on IE6/FF2 and works here.

There is two problem :
1) - for cross browser code use window.frames[0].location

2) I'm not sure why you don't have the correct result in IE. I tried :
- a first page "a.asp" that includes a "b.asp" page using an iframe
- the "b" page redirects to the "c" page

I addeed a button on the "a" page to display the info once the page is
loaded.

In both browser I see that the src attribute still point to the "b" page
while window.frames[0].location gives the "c" page location...

Good luck.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@v33g2000cwv.googlegroups. com...
Damn, It look good for a moment :(

I tried it but in internet explorer it return me the url of the parent
page (aaa.aspx) and not bbb or ccc.

In fire fox nothing happen :(

any more ideas?

Thanks.

Patrice wrote:
Try ifrm.document.location.href, ifrm being the ID of your IFRAME tag...

--
Patrice

"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@q2g2000cwa.googlegroups.c om...
Hi Patrice,

Thanks for the reply.
The question is how can I get the location of the page inside the
IFRAME?

I didn't saw any way to get the location of the real document inside
the IFRAME?

Thanks.
Patrice ???:
So using redirect could well perhaps change the document location but
leave
src unchanged (after all you didn't tell the parent frame the location
should be changed).

So something that could work would be to get the document.location for
this
document rather than using the src attribute of its parent frame.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@s48g2000cws.googlegroups.c om...
Hi.
>
I have a strange problem wuth IFRAME.
>
I have page aaa.aspx with an IFRAME that contain page bbb.aspx.
>
page bbb.aspx sometimes redirect him self to page ccc.aspx.
>
The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).
>
What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.
>
I know it complex but I really hope you can help me.
>
Thanks.
>

Jan 26 '07 #6
Hi Patrice,

I don't understand how you made it work.
I tried to use window.frams[0].location but I got "access denied"
error.
I think I read some where that there is some sort of security
protection on iframe :(

I really don't understand this.
may be it because you used asp while I use aspx?

Any way, I tried every solution I can think of and I tried to check
every properties for the "window" properties and its just didn't work.

very strange if you say that it worked fine for you.

I'll try to investigate it some more.

Any way, I really appreciate your help!
It helped me alot.

Roy.

Patrice כתב:
Tried it on IE6/FF2 and works here.

There is two problem :
1) - for cross browser code use window.frames[0].location

2) I'm not sure why you don't have the correct result in IE. I tried :
- a first page "a.asp" that includes a "b.asp" page using an iframe
- the "b" page redirects to the "c" page

I addeed a button on the "a" page to display the info once the page is
loaded.

In both browser I see that the src attribute still point to the "b" page
while window.frames[0].location gives the "c" page location...

Good luck.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@v33g2000cwv.googlegroups. com...
Damn, It look good for a moment :(

I tried it but in internet explorer it return me the url of the parent
page (aaa.aspx) and not bbb or ccc.

In fire fox nothing happen :(

any more ideas?

Thanks.

Patrice wrote:
Try ifrm.document.location.href, ifrm being the ID of your IFRAME tag...

--
Patrice

"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@q2g2000cwa.googlegroups.c om...
Hi Patrice,

Thanks for the reply.
The question is how can I get the location of the page inside the
IFRAME?

I didn't saw any way to get the location of the real document inside
the IFRAME?

Thanks.
Patrice ???:
So using redirect could well perhaps change the document location but
leave
src unchanged (after all you didn't tell the parent frame the location
should be changed).
>
So something that could work would be to get the document.location for
this
document rather than using the src attribute of its parent frame.
>
>
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@s48g2000cws.googlegroups.c om...
Hi.

I have a strange problem wuth IFRAME.

I have page aaa.aspx with an IFRAME that contain page bbb.aspx.

page bbb.aspx sometimes redirect him self to page ccc.aspx.

The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).

What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.

I know it complex but I really hope you can help me.

Thanks.
Jan 28 '07 #7
This is client side so using ASP or ASPX doesn't make a difference.

Does your iframe goes on the same domain. I used a path such "/b.asp"...
Patrice

"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@v33g2000cwv.googlegroups.c om...
Hi Patrice,

I don't understand how you made it work.
I tried to use window.frams[0].location but I got "access denied"
error.
I think I read some where that there is some sort of security
protection on iframe :(

I really don't understand this.
may be it because you used asp while I use aspx?

Any way, I tried every solution I can think of and I tried to check
every properties for the "window" properties and its just didn't work.

very strange if you say that it worked fine for you.

I'll try to investigate it some more.

Any way, I really appreciate your help!
It helped me alot.

Roy.

Patrice ???:
Tried it on IE6/FF2 and works here.

There is two problem :
1) - for cross browser code use window.frames[0].location

2) I'm not sure why you don't have the correct result in IE. I tried :
- a first page "a.asp" that includes a "b.asp" page using an iframe
- the "b" page redirects to the "c" page

I addeed a button on the "a" page to display the info once the page is
loaded.

In both browser I see that the src attribute still point to the "b" page
while window.frames[0].location gives the "c" page location...

Good luck.
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@v33g2000cwv.googlegroups. com...
Damn, It look good for a moment :(

I tried it but in internet explorer it return me the url of the parent
page (aaa.aspx) and not bbb or ccc.

In fire fox nothing happen :(

any more ideas?

Thanks.

Patrice wrote:
Try ifrm.document.location.href, ifrm being the ID of your IFRAME tag...

--
Patrice

"nicknack" <ro******@gmail.coma écrit dans le message de news:
11**********************@q2g2000cwa.googlegroups.c om...
Hi Patrice,

Thanks for the reply.
The question is how can I get the location of the page inside the
IFRAME?

I didn't saw any way to get the location of the real document inside
the IFRAME?

Thanks.
Patrice ???:
So using redirect could well perhaps change the document location but
leave
src unchanged (after all you didn't tell the parent frame the location
should be changed).
>
So something that could work would be to get the document.location for
this
document rather than using the src attribute of its parent frame.
>
>
"nicknack" <ro******@gmail.coma écrit dans le message de news:
11*********************@s48g2000cws.googlegroups.c om...
Hi.

I have a strange problem wuth IFRAME.

I have page aaa.aspx with an IFRAME that contain page bbb.aspx.

page bbb.aspx sometimes redirect him self to page ccc.aspx.

The problem is that after I loaded the aaa.aspx page I want to know
what page do I see in the IFRAME. (aaa or bbb).

What I've tried to do is to run a JS in the onLoad of aaa.aspx that
after 5 seconds get the "src" property of the IFRAME but I saw that
even if bbb.aspx redirect to ccc.aspx the source is still bbb.aspx.

I know it complex but I really hope you can help me.

Thanks.

Jan 29 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Christopher J. Hahn | last post: by
3 posts views Thread by Angel | last post: by
1 post views Thread by Z1P2 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.