Forum Moderators: open

Message Too Old, No Replies

Redirect from iframe

Need a script located in iframe html and redirecting...

         

anotherWM

11:15 am on Jan 13, 2004 (gmt 0)

10+ Year Member



2 sites.

First site contains 1x1 sized iframe,
opening example.com/iframe.html there.

Is there any java script that I can put into iframe.html so it will be redirecting main page?

I tried "top.document.location =",
but it was stopped by hosting :(.

Examples:
1.main site: asp-asp2.example.net/asp.html
2.iframe: asp-asp.example.net/iframe_aaa.html

Any variant could be useful.

Sincerely,
Another WM

[edited by: korkus2000 at 12:55 pm (utc) on Jan. 13, 2004]
[edit reason] Examplified URLs [/edit]

korkus2000

12:56 pm on Jan 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>but it was stopped by hosting

Could you expand on this?

BlobFisk

2:30 pm on Jan 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you want the JavaScript to redirect the iFrame page to the main page?

anotherWM

4:50 pm on Jan 13, 2004 (gmt 0)

10+ Year Member



I use the free hosting provided above,
and I believe they do something that interrupt my script action.

All I need is to redirect the main page that contains iframe code. And to do that, I can modify iframe.html only :(.

BlobFisk

5:50 pm on Jan 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is the main page you mention your hosts or your own?
Is the iFrame you mention your hosts or your own?

I'm still a little confused! Are you trying to get rid of your hosts advertising iFrame from you pages?

Have you tried just parent.location?

anotherWM

11:56 pm on Jan 13, 2004 (gmt 0)

10+ Year Member



Both pages are mine, but
I can modify iframe.html only (for some reason).

I'm not trying do run from hosting or etc.
I just need to redirect the Main page to whenever I need, using java script inserted into iframe.html

Please post an example of parent.location for my case.

Thank you.

BlobFisk

11:25 am on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unless, as you mentioned, there is a script blocker in place - redirect the parent location should work.

parent.location.href='page.html'

HTH

anotherWM

9:30 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



Thank you BlobFisk, it works!

My best regards to all webmasterworld.com members.