470,590 Members | 2,525 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,590 developers. It's quick & easy.

Reusing same windows with HTTPS links

Jon
I have links that open https secondary windows using:

window.open(url, windowName);

The windowName is always the same but I keep getting new windows. Is
it possible for each of the links to open in the same window?

Thanks,

Jon
Jul 20 '05 #1
4 3992
Hi,
window.open() will always open new ones.
Try windowName.location=url

Kien

jo*@jkworld.com (Jon) wrote in message news:<90*************************@posting.google.c om>...
I have links that open https secondary windows using:

window.open(url, windowName);

The windowName is always the same but I keep getting new windows. Is
it possible for each of the links to open in the same window?

Thanks,

Jon

Jul 20 '05 #2

ca*********@hotmail.com (Kien) writes:
jo*@jkworld.com (Jon) wrote in message news:<90*************************@posting.google.c om>...
I have links that open https secondary windows using:

window.open(url, windowName);

The windowName is always the same but I keep getting new windows. Is
it possible for each of the links to open in the same window?


They should. Can you show us the page that fails?

[top post fixed]
window.open() will always open new ones.
Not if the windowName is the same, and is a valid window name.
Try windowName.location=url


That will rarely work. If "windowName" is the name of the window that
is opened, it doesn't become a global variable. If it is the name of a
sub-frame, it will only be a global variable in some browsers.

If you man to write

var windowName = window.open(...)
and then
windowName.location = url
then it will probably work (if window.open does :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
Jon
Here is my code:

in the .jsp file:
<a target="NEWWINDOW"
href="javascript:formNewWindow('<%=ers.getURL()%>' )"
class="sbLinkBlue">View Detail</a>

in newWindow.js file
function formNewWindow(url)
{
var windowName ='NEWWINDOW';
window.open(url,windowName);
}

Every time View Detail is clicked on the same page or different pages,
a new window is created. The link always begins with https. I tested
the above with http and it works fine.

Jon

Lasse Reichstein Nielsen <lr*@hotpop.com> wrote in message news:<is**********@hotpop.com>...
ca*********@hotmail.com (Kien) writes:
jo*@jkworld.com (Jon) wrote in message news:<90*************************@posting.google.c om>...

I have links that open https secondary windows using:

window.open(url, windowName);

The windowName is always the same but I keep getting new windows. Is
it possible for each of the links to open in the same window?


They should. Can you show us the page that fails?

[top post fixed]
window.open() will always open new ones.


Not if the windowName is the same, and is a valid window name.
Try windowName.location=url


That will rarely work. If "windowName" is the name of the window that
is opened, it doesn't become a global variable. If it is the name of a
sub-frame, it will only be a global variable in some browsers.

If you man to write

var windowName = window.open(...)
and then
windowName.location = url
then it will probably work (if window.open does :)

/L

Jul 20 '05 #4
Jon wrote:
in newWindow.js file
function formNewWindow(url)
{
var windowName ='NEWWINDOW';
window.open(url,windowName);
}

Every time View Detail is clicked on the same page or different pages,
a new window is created. The link always begins with https.
The URI of the link, not the link itself.
I tested the above with http and it works fine.
Of course it works, but

window.open(url, "NEWWINDOW");

works as well as

window.open(url, "foobar");

does. There is no additional variable necessary and the value of
the second argument, if different from "_blank", should not matter
if it is the same on every call. That the behavior depends on the
protocol used in the first argument's value could only be a
browser-dependent feature to prevent going around the Same Origin
Policy.
[Top post]


Do not do that.
PointedEars
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Peter Chant | last post: by
3 posts views Thread by muttu2244 | last post: by
1 post views Thread by Luis Esteban Valencia | last post: by
3 posts views Thread by E | last post: by
1 post views Thread by Fenno | last post: by
44 posts views Thread by Viken Karaguesian | last post: by
2 posts views Thread by Greg Collins [Microsoft MVP] | last post: by
8 posts views Thread by howa | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.