0

I have several links in a page that opens a popup window to display the contents of these links.

On Chrome when I click on a link (see code below) the popup window appears front and when I click on a second link, the content changes and the popup its still front: This is the behavior I want to have.

But with Firefox and IE, when I click on the first link the popup appears and when I click on the second link, the content changes but the popup window is minimized.

How to have the same behavior as Chrome on Firefox and IE?

Here's the code:

function openpopup(popurl,winName){
   winpops=window.open(popurl,winName,'toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=1020px,height=300px,left=125px,top=300px,scrollbars=yes').focus();
} 


<a href="centent1.txt" onclick="openpopup(this.href,'window1'); return false;">centent1</a>
<a href="content2.txt" onclick="openpopup(this.href,'window1'); return false;">centent2</a>

I edit the message to not create a second topic. With IE the text displayed in the popup window does not contain newlines, it is unreadable. Is there something to add more for proper formatting?

Jils
  • 783
  • 5
  • 12
  • 32
  • I resolved the first issue by adding the method "focus" (see edited code). – Jils Oct 02 '13 at 10:45
  • I resolve the second issue by adding
     between my content.
    http://stackoverflow.com/questions/656605/jquery-text-call-preserves-newlines-in-firefox-but-not-in-ie
    – Jils Oct 02 '13 at 11:59

1 Answers1

0

Simply add .focus()

function openpopup(popurl,winName){

    winpops=window.open(popurl,winName,'toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=1020px,height=300px,left=125px,top=300px,scrollbars=yes',true)
    winpops.focus();

} 
Ricky Boyce
  • 1,772
  • 21
  • 26
  • I posted the solution in the same time as you :), thanks. Now I try to resolve the other issue that I have. – Jils Oct 02 '13 at 11:09