Closed Thread Icon

Preserved Topic: Location = Target? :( (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18521" title="Pages that link to Preserved Topic: Location = Target?  :( (Page 1 of 1)" rel="nofollow" >Preserved Topic: Location = Target?  :( <span class="small">(Page 1 of 1)</span>\

 
Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 06-28-2001 18:41

Ok, I'm wanting to redirect to another page with JS but I want it to break out of frames. I'm currently using:

location = "url.html"

But I'm using this inside a framed page.

Is their any way to specify what frame to open the new page in? Even just to break out of the frames completly will do.

Thanks in advance.

everybody needs a swamp bear

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-28-2001 19:37

I think it's
top.window.location.href = 'wherever.com'


Walking the Earth like Kane

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 06-28-2001 19:52

EXECELENT!

That worked like a charm, thanks bitdamaged.



everybody needs a swamp bear

Edit: A two line post and I still F*&K it up!!!!

[This message has been edited by Dracusis (edited 06-28-2001).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-28-2001 21:13

Oh I didn't mention to specify a specific frame you need to name the frame in yourframest

<frame name="theFrame" ...

then the easiest way is to start at the "top" and work your way down.

top.theFrame.location = 'whatever.com';

If you have embeded frames you would do this
top.frameset.theFrame.location.href... etc.

Top puts you at the very "top" level from which it's relatively easy to work your way down.

Not to get confusing but the other relevant name is parent which refers to the parent doc (up one level). parent.location.href=' whatever.com'; should also have worked for you but I think "top" is better and easier.


Walking the Earth like Kane

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 06-29-2001 06:20

Yeah cool. In my case I'm using a page with... let me count 5 frames (I'm centering a box in the middle of the browser window) but there is a limited amount of content in some of the other frames at times. So to hide the ugly html names I've also used a single frame document which encloses the entire site.

So, it's a 5 frame document inside a one frame document. But I've figured things out. Thanks again for that extra info, I'm sure it will come in handy

And I know what I'm doing with this frames is usualy a bad practice (is stop's people from bookmarking a particular page in the site doesn;t it?? or does it not?? ) but it's a tiny site anyways...

everybody needs a swamp bear

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 06-30-2001 00:20

if (parent.frames[1]){ top.location.href = self.location.href; }

This will cause your page to break out of someone elses frameset.

Your pal, -doc-

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 06-30-2001 23:18

Hey thanks Doc! that'll come in handy

everybody needs a swamp bear

monoj
Neurotic (0) Inmate
Newly admitted

From: Howrah, West Bengal, India
Insane since: Jul 2001

posted posted 07-02-2001 18:29

Thanks.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 07-10-2001 20:31

The solutions all work but only where JavaScript is enabled. I believe this works in all circumstances:

<META HTTP-EQUIV="Window-target" CONTENT="_top">

Emps

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 10-09-2001 10:29

Emps, how do you specify the number of secs after which I want the redirection to happen?

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 10-09-2001 20:48

<META HTTP-EQUIV="Refresh" CONTENT="5; URL=http://www.newlocation.com/">

This is how you can redirect a page after 5 seconds. I don't know how, or if, this works in conjunction with the solution Emps gave.

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 10-11-2001 16:28

Bugmis, I know that method...but Emps method seems capable of escaping from frames...

can what you wrote escape from frames too? by reloading into a specified target?

« BackwardsOnwards »

Show Forum Drop Down Menu