1. Open the new window, window. open (), which is not blocked by the browser. But in the Ajax method, the new window is blocked, as shown below:
Function mfopen (ID, name) {jquery. Ajax ({type: "Get", datatype: "text", URL: "userlogin. aspx? Method = init ", success: function (MSG) {var JSON = eval (" ("+ MSG +") "); If (JSON. result = "100") {If (JSON. isagtuser! = "0") {jerppopup ("not qualified", 'No. aspx ', 415, 90, function () {});} else {var cid = ID; var cname = Name; var url = 'chuli. aspx? Id = '+ CID +' & name = '+ escape (cname) +' & num = math. random () '+ ''; window. open (URL) ;}} else {jerppopup ("You have not logged on. Please log on first", 'login. aspx? Fun = pingjiaagent2 ', 410,180, function (){});}}});}
2. By default, Ajax is asynchronous and modified to synchronous execution. This can solve the problem that a new window is blocked by the browser, as shown below:
Function mfopen (ID, name) {jquery. Ajax ({type: "Get ",Async: false,Datatype: "text", URL: "userlogin. aspx? Method = init ", success: function (MSG) {var JSON = eval (" ("+ MSG +") "); If (JSON. result = "100") {If (JSON. isagtuser! = "0") {jerppopup ("not qualified", 'No. aspx ', 415, 90, function () {});} else {var cid = ID; var cname = Name; var url = 'chuli. aspx? Id = '+ CID +' & name = '+ escape (cname) +' & num = math. random () '+ ''; window. open (URL) ;}} else {jerppopup ("You have not logged on. Please log on first", 'login. aspx? Fun = pingjiaagent2 ', 410,180, function (){});}}});}