943,514 Members | Top Members by Rank

Ad:
Nov 6th, 2008
0

How to get to the First parent location?

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
zanzo is offline Offline
58 posts
since Feb 2008
Jan 27th, 2009
0

Re: How to get to the First parent location?

I would love an answer to this as well.....
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zl-zd is offline Offline
1 posts
since Jan 2009
Jan 28th, 2009
0

Re: How to get to the First parent location?

Wel am not sure if this wil work.
First, try to add a <base> module with your preferred (x)html document.
html Syntax (Toggle Plain Text)
  1. <base target="_top" />
then try to incoporate the following bits of code in your script.
javascript Syntax (Toggle Plain Text)
  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}/)) }
Featured Poster
Reputation Points: 114
Solved Threads: 138
Posting Shark
essential is offline Offline
973 posts
since Aug 2008
Jan 28th, 2009
0

Re: How to get to the First parent location?

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>
Featured Poster
Reputation Points: 114
Solved Threads: 138
Posting Shark
essential is offline Offline
973 posts
since Aug 2008
Jan 29th, 2009
0

Re: How to get to the First parent location?

I think w3schools.com is helpful for you....
Reputation Points: 20
Solved Threads: 1
Newbie Poster
gurshan is offline Offline
15 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: AJAX problem in firefox but fine in IE
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Ajax problem with DIV update





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC