Reusing same windows with HTTPS links

J

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
 
L

Lasse Reichstein Nielsen

(e-mail address removed) (Jon) wrote in message news:<[email protected]>...

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
 
J

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 said:
(e-mail address removed) (Jon) wrote in message news:<[email protected]>...

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
 
T

Thomas 'PointedEars' Lahn

Jon said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top