window.open的火狐、谷歌兼容写法

经常看到群里有朋友问,在火狐和谷歌下的window.open要怎么写,而且还要能设置宽高,我也曾经遇到过这个问题,然后在网上搜索一番,几经艰辛终于找到答案,希望给以后的朋友方便。此方法只能通过按钮点击触发。

window.onload=function(){
var oInp=document.getElementById('input1');

    oInp.onclick=function(){
        window.open('http://www.baidu.com',null,'height=300,width=400');
    };
};
原文地址:https://www.cnblogs.com/masita/p/4197089.html