javascript不能同时打开多个网页

location.href = "http://xshuo.xsfaya.com/channel/10";
location.href = "https://g.ieeod0.com/w/sys_cs.html?c=10120&uid=524714&";
在javascript中上面代码只能打开下面不能打开上面,为什么?上面的代码同时编写,同时运行

用window.open试试

location.href是替换当前页面的地址,不是打开新的页面,只能用window.open。但window.open有些浏览器会阻止弹出页面。如果是由用户点击触发打开页面可以用a标签,target为_blank,然后标签的点击事件用location.href替换替换当前页面

这个问题我没有一个采纳,因为我要提最新问题所以不得以采纳一个