By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,341 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

How to get to the First parent location?

P: 16
I want to get to the parent location each time I'm adding a record. the problem is that i have a nested iframes, and each time the number of those is incremented:

at first adding record i have the location like this: parent.location
second: parent.parent.location
third: parent.parent.parent.location

how could i get to the initial location, without adding each time "parent."
Nov 6 '08 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 15k+
P: 16,027
Use top.location.
Nov 6 '08 #2

P: 16
ok but if I want to write this how to:

Nov 6 '08 #3

Expert Mod 15k+
P: 16,027
Wherever you have multiple levels of parents, use top to get to the top-level parent.
Nov 6 '08 #4

P: 16
ok it works,


best regards,
Nov 6 '08 #5

Expert Mod 15k+
P: 16,027
Glad it does, and you're welcome :)
Nov 6 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.