-2

My code is not working for firefox but same code is working in chrome. Here is my code:

$( "#confirm" ).dialog({

        resizable: true,
        modal: true,
        buttons: {

            "Yes": function() {
                newWindow = window.open(url,"myWindow","status=1,width=870,height=530");
                newWindow.focus();

                $( this ).dialog( "close" );
             }
        }
   });

I want to bring focus if window is already opened. But not working in firefox.

chandni
  • 159
  • 1
  • 7

1 Answers1

0

For some reason current window is getting focus. To solve this problem add one more function below focus like this:

$( "#confirm" ).dialog({

    resizable: true,
    modal: true,
    buttons: {

        "Yes": function() {
            newWindow = window.open(url,"myWindow","status=1,width=870,height=530");
            newWindow.focus();
            newWindow.moveTo(0,0);

            $( this ).dialog( "close" );
         }
    }
});

So, add moveTo(0,0); this will bring focus again to window and doesn't effect to window.

chandni
  • 159
  • 1
  • 7