Page 1 of 1
Page name
Posted: Sun Oct 17, 2004 1:36 pm
by Shendemiar
How do i identify my page so that i can later open links to it by target="something"
I can name Frames and even whole pages when created by javascript, but how do i name a page using html?
Posted: Sun Oct 17, 2004 3:37 pm
by feyd
targets go to frames, they do not target in regard to page names.. so I'm not too sure what you're asking..

Posted: Sun Oct 17, 2004 3:45 pm
by Shendemiar
Targets can be opened into whole windows also, not just frames. If i make a popup window with javascript, i can give a name to it and use that name later/elsewhere in the document to open links in that window.
I need to know how can i name a window by other methods than javascrip.
Javascript
will open a window by name "somename"
Code: Select all
<a href="something" taget="somename">link</a>
will open into the newly created window named "somename"
But what is the name of the default window that gets opened when browser opens? Can it obtain a name from code somewhere somehow?
Can i at least receive the default name by some script?
Posted: Sun Oct 17, 2004 3:52 pm
by John Cartwright
target="_blank"
???
I too do not know what you are asking
Posted: Sun Oct 17, 2004 3:54 pm
by feyd
a new window is a frame. Or rather, a frame is a window.
there is no real name the default window gets. The current "window" can be accessed through the window/self window objects in Javascript.
Posted: Sun Oct 17, 2004 4:20 pm
by Shendemiar
The case is that i have a window and a link there that opens a popupwindow with some stuff in it. There I need to have a link that opens stuff back in the original window.
The only problem is that the original window doesn't have a name i could use in the href target.
Can i receive something (name, pointer, object etc) with this javascript window.self stuff?
(and pass it as a php variable to the popup window when it's created and that way include it in the link in the pop-up window)
Posted: Sun Oct 17, 2004 4:39 pm
by feyd
if you want to access the window that opened a popup, in the popup you can access the "opener" window object. The parent object may also work.
Posted: Sun Oct 17, 2004 4:57 pm
by Shendemiar
Okay, i got it!
Javascript:
Code: Select all
<?php
echo " window.self.name='main' \n";
?>
Did a lot of good for me
