javascript location

| | Comments (0)

For self:
location.href="whateva.htm";

For blank:
window.open="whateva.htm";

For parent:
parent.location.href="whateva.htm";

For top:
top.location.href="whateve.htm";

For SomeFrame:
parent.SomeFrame.location.href="whateva.htm";

Meta refresh can't target a frame

Problem: A meta refresh tag can't target a frame other than the current.

Workaround: Use a JavaScript timed location change.

Code Example: We have a frame named right. The delay is 3 seconds.


setTimeout("top.right.location = 'p.html'", 3000);


Note: Remember that top is a reserved word. So use names like upper and lower instead of top and bottom.

Leave a comment

March 2009

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Pank published on December 8, 2003 2:58 PM.

C/P 值 was the previous entry in this blog.

udhcpc is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.