点选select后,再点击解发window.open会被屏蔽了

解决方案 »

  1.   

    想了解下的是:如果没点选select,window.open会不会被屏蔽
    现在浏览器,大多都一弹广告的形式将window.open()方法打开的页面屏蔽掉,建议LZ使用form如<form id="form1" action="xxx.aspx" method="get" target="_blank">
    <select name="sel">
    <option>这儿放置你的select</option>
    </select>
    </form>
      

  2.   

    再在select中的onchange事件中将form提交,就可以达到你要的效果
      

  3.   

    设select的id=select1
    function init()
    {
     var select1=document.getElementById("select1");
     select1.onchange=function(){
     window.open(....
     }
    }
    <body onload="init()" ...