Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: a while loop


Message #1 by "Hordur Kr. Heidarsson" <eight@s...> on Tue, 22 Oct 2002 00:01:37
How about 
var myWindow=window;
while (myWindow.parent!=myWindow) {  //top-level window is its own parent
	document.write(myWindow.document.referrer);
	myWindow=myWindow.parent;
}
	

-----Original Message-----
From: Hordur Kr. Heidarsson [mailto:eight@s...]
Sent: Tuesday, October 22, 2002 12:02 AM
To: javascript
Subject: [javascript] a while loop


weird... last post didn't show the subject....

Can I make a while loop that prints out:

1
parent.document.referrer

2
parent.parent.document.referrer

3
parent.parent.parent.document.referrer

4
parent.parent.parent.parent.document.referrer

and so on until the while condition is met (or an error occours)...

is there any trick to this kind of stuff?


thanks,
Hordur

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

  Return to Index