window.open()瀏覽器彈不出新窗口

瀏覽器使用的是360,用的IE8的兼容模式,使用$.ajax的方式請求,window.open()彈窗彈不出來

$.ajax({
	url: "<%=path%>/sso/servlet/IntegralEfficiencyServlet",
	type: "post",
	contentType: "application/x-www-form-urlencoded",
	data: {"TOKEN": "<%=request.getParameter("token")%>"},
	dataType: "text",
	success: function(url){
		console.log(url);
		window.open("http://www.baidu.com");
		return;
	},
	error:function(response){
		console.log("error");
	}
});

然後我試着用$.post發送請求,結果就可以正常彈出窗口。

$.post("<%=path%>/sso/servlet/IntegralEfficiencyServlet", {
	Action: "post",
	TOKEN: "<%=request.getParameter("token")%>",
	contentType: "application/x-www-form-urlencoded"
},
function(data, textStatus){
	window.open(data);
});
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章