Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE 7 and Windows Vista

Status
Not open for further replies.

youngApprentice

Programmer
Jan 28, 2007
16
US
Here's a typical situation:
you have a link set to open a window if JavaScript is enabled, with the parent window going to the link if JavaScript is not enabled.

<a href="/myFolder/myPage.htm" title="my title" onClick="popAWindow('/myFolder/myPage.htm','500','400'); return false;">My Link Text</a>

This works in Firefox, IE 6, IE 7, Netscape 9, Opera, etc. for Windows XP but does not work in IE 7 on Windows Vista, while still working in FF, Netscape, and Opera in Vista. In Windows Vista, the window pops up and the parent page goes to the content, ignoring the return false.
Anyone have a good workaround? Is removing the href attribute a valid solution when JS is enabled?

TIA,
youngApprentice
 
Should work fine (assuming that your function popAWindow() doesn't return anything first.

You could try this:
Code:
... onclick="[b]void([/b]popAWindow('/myFolder/myPage.htm','500','400')[b])[/b]; return false;" ...
Which will ignore a return value from that function (if one is returned).

I haven't got vista to test this.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
I appreciate the response, however, that's the reason I posted my question. It "should work fine", but it doesn't work properly at all in IE 7 on Windows Vista.

From a web server, I get the popup with the content and the parent window then switches to the anchor tag's href, instead of staying on the page with the link.

If I run this as a file without using a Web server, I get two windows to open, one with the JavaScript popup content one with the address in the anchor tag's href.

TIA,

youngApprentice
 
So, using void() was no help to you then? You didn't actually address the fact I posted something you could try.

I don't have Vista, so can hot help any further.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Thanks and sorry, that's correct, void didn't work as well as the original method of using onclick.

Thanks for helping, though this is frustrating since it works as expected in Windows XP and IE as well as other browsers in Vista.

youngApprentice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top