I need to specify links in my popup that I open with window.createPopup();.
But if I click on a link, nothing happens. It seems, that the browser ignores the href attribute.
<a href="test.html">test</a>
Clicking on this link does not redirect to “test.html” – nothing happens like it would be href="#".
Please no “don’t use this method, because it’s IE only” comments.
I’ve read, that I need do specify a target.
How can I get my links working?
IE’s Popup objects are separate windows, with separate documents, that are unable to take focus and cannot navigate. My guess is that you don’t want to navigate the popup window anyway, you probably want to navigate the popup’s opener. One trick you could use is to set a reference to the parent window when you create the popup object:
Then, in your HTML or JavaScript code, add an event handler to the links to make the owner window navigate to the specified
href:Alternatively, if you’re creating the links via the DOM, just add them at creation time: