0
votes

Am generating one popup using window.open() when click on a button.

The click button which generates popup is in social.html

My code is,

$.get(url).success(function(req)
{
    var win=window.open('','_blank','width=700,height=500,top=0,left(screen.width-700)');
    win.document.write('<link rel="stylesheet" href="/css/mycss.css" />' + req);
    win.document.close();

});

Am writing ajax call response(which contains html code) into the popup. Contents inside the popup has many external links and which opens in different window(again using window.open) and working properly. Problem is, When i click on any links the popup redirects to social.html. It should not redirect

Please help i tried but couldn't get solution.

1

1 Answers

0
votes

That should not happen. I tried what you have mentioned. Please check the link's href attributes, may be there is relative path.

Try to provide full path (absolute path) in href attributes in anchor tag. Or there may be any redirection rule (htaccess or in php) that prevents it to open the link on the popup. Thanks