views:

109

answers:

3

HI all.

I have a static HTML page which is named via javascript as such: window.name = "windowname". This window opens a popup window, which contains links that target 'windowname'.

This works as expected in IE/FF/Chrome and opens the links on the opener, howeve Safari opens all links in a new window and not the opener.

Is anyone aware of a workaround or solution to this other than using javascript to open the links via opener.location.href? Is this a security 'feature' of Safari or some other kind of issue?

Thanks in advance -

b

A: 

Trying setting the "id" attribute to the same string as the name.

Pointy
A: 

Not 100% sure what you problem is without being able to see your code but the following worked for me in Safari 4:

windowname:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>untitled</title>

</head>

<body onload="window.name='windowname'">
<a href="#" onclick="window.open('popup.html')">Open</a>

</body>
</html>

popup:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>untitled</title>

</head>

<body>
<a href="http://google.com" target="windowname">test</a>
</body>
</html>
macinjosh
Thanks for the time - this will work for me as a first click, can you add another link to the popup and change the opener a second time? Again, it works fine locally, but not on a server...
WillyCornbread
A: 

No resolution for this was ever found, I had to go with a method that didn't use pop-up windows due to this.

thanks for the effort.

b

WillyCornbread