admin管理员组

文章数量:1410730

I want to open a window from PHP. As it's impossible to do with PHP, I send to Javascript the following mand:

echo '<script type="text/javascript" language="javascript">window.open("/help/help_central.php","my window", "height=200, width=200, top=100, left=500, menubar=0, toolbar=0, location=0, status=0");</script>'; 

With FF 11.0 only height,width,top,left can be changed (for me !). I tried with yes/no but same effect.
Do you know a solution patible for ALL mon browsers (FF,IE,Safari,Chrome,Opera) ?

I want to open a window from PHP. As it's impossible to do with PHP, I send to Javascript the following mand:

echo '<script type="text/javascript" language="javascript">window.open("/help/help_central.php","my window", "height=200, width=200, top=100, left=500, menubar=0, toolbar=0, location=0, status=0");</script>'; 

With FF 11.0 only height,width,top,left can be changed (for me !). I tried with yes/no but same effect.
Do you know a solution patible for ALL mon browsers (FF,IE,Safari,Chrome,Opera) ?

Share Improve this question edited Apr 25, 2012 at 13:53 ExternalUse 2,0752 gold badges26 silver badges37 bronze badges asked Apr 25, 2012 at 12:21 BertaudBertaud 2,9285 gold badges39 silver badges48 bronze badges 5
  • 2 QuirksMode - Popups – Brad Christie Commented Apr 25, 2012 at 12:24
  • 2 try with "mywindow" without space on the name not "my window" – jogesh_pi Commented Apr 25, 2012 at 12:25
  • Pop up blockers will block this pop up in the wild. – epascarello Commented Apr 25, 2012 at 12:34
  • mywindow or my windows: that doesn't change ! – Bertaud Commented Apr 25, 2012 at 22:05
  • but QuirksMode gives answer to my questions ! – Bertaud Commented Apr 25, 2012 at 22:11
Add a ment  | 

1 Answer 1

Reset to default 3

Normally yes it works everywhere however not all the features are supported by all browsers.

This article is a good read to find out what works and what doesn't depending on the browsers.

http://www.quirksmode/js/popup.html

Another good reference is

http://www.gtalbot/BugzillaSection/Bug195867GDR_WindowOpen.html

You might want to consider using a modal window instead as that you will manage to make work everywhere and popup might also get blocked by browsers plugin security settings when a modal wont.

本文标签: javascriptwindowopen compatible for all browsersStack Overflow