点击打开的窗口和特定的大小

我有这样的链接:

<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,') 

我想新的打开窗口以特定的大小打开。 我如何指定高度和宽度?

 <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> 

宽度和高度是像素。

 window.open ("http://www.javascript-coder.com", "mywindow","menubar=1,resizable=1,width=350,height=250"); 

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

:]

 window.open('http://somelocation.com','mywin','width=500,height=500'); 

只要将它们添加到参数string。

 window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=350,height=250') 
 <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> 

这些是来自Mozilla开发者networking的window.open页面的最佳实践:

 <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>