Forum Moderators: open

Message Too Old, No Replies

FireFox and HTML anchor targets

Failing to update content of a named window

         

Josteino

4:53 pm on Oct 16, 2005 (gmt 0)

10+ Year Member



Dear forum,

in one page (index.php) I use this sentence to set the name of the window:

<body onload='self.name="indexpage"'>

In this page there is a <img> tag containing this:
onclick='window.open("galleryselect.php","galleryselect","lots_of_size_description")'

The galleryselect.php script generates HTML links that refer back to the first window:

<a href='index.php?M=24'
target='indexpage'
onclick='self.close()'>
April-2003</a>

Now, this works fine in IE, but not in FireFox. FF will open the window containing galleryselect.php, but clicking the <a href...> will not update the indexpage window.

I just can't figure out what I do wrong. Any suggestions?

Best,
Josteino

tedster

5:46 pm on Oct 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have had success updating the parent page by using window.opener.parent.location to address it, instead of a target attribute.

<a href='index.php?M=24' onClick="window.opener.parent.location='index.php?M=24';window.close();return false">

I'm not sure why FF doesn't acknowledge the "name" assignment for self in your approach.

Josteino

6:04 pm on Oct 16, 2005 (gmt 0)

10+ Year Member



Thanks tedster,

It solved my problem. :)

I also tested window.opener.document.... and that worked too, in both browsers.

Happy day!

Josteino