Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference to the main page

Status
Not open for further replies.

powerranger

Technical User
Feb 14, 2003
10
0
0
US
I would like to ask how do I code the javascript in this situation:

Main page opens child1. Child1 opens child2 and closes itself. How child2 refers to the Main page. How to maintains a relationship to the main page when you have multiple children. Thanks.
 
give the child1 window the name child1

in child2 form try
child1.opener.location.....

i dont think it will work but it is just a idea...

Known is handfull, Unknown is worldfull
 
there is a property called .referrer try self, window, document objects. I have seen JS on a JS website to do this or maybe here in Tek-Tips. How to pass it to the next grandchild I can't see yet.
 
Just a thought and not enough specifics BUT..... conceptually the method relies on plonking the url as text in the body and providing access to it. (doesn't document.all.innerhtml or similar sounding property give you all the text which could then be searched?)

If you document.write to the (say) top of page (after <BODY> with a string something like

&quot;<a href=&quot; + referrer + &quot; id=1>back1</a>&quot; in child 1 you will have access to the tag 1 and in loading child2 you would have to do a similar document.write after you have constructed a string from :

document.tags[1].href (I am a bit vague on the precise properties and set-up - document.all may do similar)

Then in child2 you have the href for back1 or back2 via the indexed property

If you wanted you could colour the text to hide it in the background (maybe) and it only works for as many generations as you program for in each generation. Ie it is not universal.

I have been looking at properties in Visual Studio and seen a lot I didn't need in passing (needs debug tags!!). Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top