How to get to the First parent location?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Feb 2008
Posts: 58
Reputation: zanzo is an unknown quantity at this point 
Solved Threads: 0
zanzo's Avatar
zanzo zanzo is offline Offline
Junior Poster in Training

How to get to the First parent location?

 
0
  #1
Nov 6th, 2008
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:

eg.
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."


Best regards,
zanzo
Best regards,
zanzo
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1
Reputation: zl-zd is an unknown quantity at this point 
Solved Threads: 0
zl-zd zl-zd is offline Offline
Newbie Poster

Re: How to get to the First parent location?

 
0
  #2
Jan 27th, 2009
I would love an answer to this as well.....
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

Re: How to get to the First parent location?

 
0
  #3
Jan 28th, 2009
Wel am not sure if this wil work.
First, try to add a <base> module with your preferred (x)html document.
  1. <base target="_top" />
then try to incoporate the following bits of code in your script.
  1. function someFunc() {
  2. //Storing location as array's and get the ref n#.
  3.  
  4. var thisLocation = [];
  5. thisLocation.push(parent.location);
  6.  
  7. if (confirm('Whatever is true!','Test') == true) { alert(thisLocation[0].match(/\w\.[xhtml]{1}/)) }
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

Re: How to get to the First parent location?

 
0
  #4
Jan 28th, 2009
Sorry i missed something on my first post.
It should be something like this
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <script type="text/javascript">
  2. function someFunc() {
  3. //Storing location as array's and get the ref n#.
  4.  
  5. //Try to run this demo
  6.  
  7. var thisLocation = [];
  8. thisLocation.push(parent.location);
  9.  
  10. var loc = new String(thisLocation[0]);
  11.  
  12. if (confirm('Whatever is true!','Test') == true) { alert(loc.match(/\w+\.[html]{4}|\w+\.[xhtml]{5})) }
  13. else { alert(loc); }
  14. }
  15. window.onload = someFunc;
  16. </script>
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 16
Reputation: gurshan is an unknown quantity at this point 
Solved Threads: 0
gurshan gurshan is offline Offline
Newbie Poster

Re: How to get to the First parent location?

 
0
  #5
Jan 29th, 2009
I think w3schools.com is helpful for you....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC