Page name

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Page name

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.. :?:
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post 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

Code: Select all

open(url,"somename",attributes);
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?
Last edited by Shendemiar on Sun Oct 17, 2004 4:00 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

target="_blank"


???

I too do not know what you are asking
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post 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)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

Okay, i got it!

Javascript:

Code: Select all

<?php
echo " window.self.name='main' \n";    
?>
Did a lot of good for me

:D
Post Reply