简体   繁体   中英

Closing child popup window fails in IE8

I have a problem closing a child popup window. When I click on the link on the parent window, a new child window opens (this window is used to launch the right software using the URL). My goal is to get this child window closed as soon as it launches the required tool, leaving the parent window open.

This is my code:

<a href="<s:property value="URL" />" rel="notes" target="_self">

The JQuery :

$recherche_globale_a_rel.filter('[rel="notes"]').click(function () {
    var myPage = window.open($(this).attr('href'));
    myPage.close();
    return false;
}); 

The problem is that the child window closes properly when using firefox, but doesn't close when I use IE (IE8). Any help??

Seems like you have problem here:

<a href="<s:property value="URL" />" rel="notes" target="_self">

Since you have doble quotes inside double quotes, try changing it:

<a href="<s:property value='URL' />" rel="notes" target="_self"></a>

or:

<a href="<s:property value=\"URL\" />" rel="notes" target="_self"></a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM