janela aberta onclick e tamanho específico

Tenho um link como este:

<a href="/index2.php?option=com_jumi&amp;fileid=3&amp;Itemid=11" onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,')

quero que a nova janela de abertura abra num tamanho específico. Como especificar a altura e largura?

Author: Mian Kamran, 2010-01-28

6 answers

<a href="/index2.php?option=com_jumi&amp;fileid=3&amp;Itemid=11"
   onclick="window.open(this.href,'targetWindow',
                                   'toolbar=no,
                                    location=no,
                                    status=no,
                                    menubar=no,
                                    scrollbars=yes,
                                    resizable=yes,
                                    width=SomeSize,
                                    height=SomeSize');
 return false;">Popup link</a>

Onde a largura e a altura são pixels.

 144
Author: Larry Hipp, 2014-08-22 20:02:52
window.open ("http://www.javascript-coder.com",
"mywindow","menubar=1,resizable=1,width=350,height=250");

De

Http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

:]

 25
Author: Adam Kiss, 2010-01-28 19:13:08
window.open('http://somelocation.com','mywin','width=500,height=500');
 16
Author: TGuimond, 2010-01-28 19:14:07

Basta adicioná-los ao parâmetro string.

window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=350,height=250')
 12
Author: Joel, 2010-01-28 19:13:05
<a style="cursor:pointer"
  onclick=" window.open('http://YOUR.URL.TARGET','',' scrollbars=yes,menubar=no,width=500, resizable=yes,toolbar=no,location=no,status=no')">Your text</a>
 9
Author: aptx.wap.sh, 2017-03-23 19:19:27

Estas são as melhores práticas da janela da rede de desenvolvedores Mozilla.abrir Página:

<script type="text/javascript">
var windowObjectReference = null; // global variable

function openFFPromotionPopup() {
  if(windowObjectReference == null || windowObjectReference.closed)
  /* if the pointer to the window object in memory does not exist
     or if such pointer exists but the window was closed */

  {
    windowObjectReference = window.open("http://www.spreadfirefox.com/",
   "PromoteFirefoxWindowName", "resizable,scrollbars,status");
    /* then create it. The new window will be created and
       will be brought on top of any other window. */
  }
  else
  {
    windowObjectReference.focus();
    /* else the window reference must exist and the window
       is not closed; therefore, we can bring it back on top of any other
       window with the focus() method. There would be no need to re-create
       the window or to reload the referenced resource. */
  };
}
</script>

<p><a
 href="http://www.spreadfirefox.com/"
 target="PromoteFirefoxWindowName"
 onclick="openFFPromotionPopup(); return false;" 
 title="This link will create a new window or will re-use an already opened one"
>Promote Firefox adoption</a></p>
 3
Author: Nicolas Renon, 2014-10-04 07:41:59