<script language= "JavaScript" >function Orderprint () {var formurl = "Savedata_url"; var formprint = "";//The window $.ajax ({url:formurl, Data: $ (' #form1 ') to pop up after saving successfully. Serialize (), DataType: "HTML", async:false,//----------1. Focus, perform the current Save action first type: "POST", success:funct Ion (data) {if (data) {formprint = "http://baidu.com"; } else {alert ("Save Failed"); }}, Error:function () {alert ("Save Failed"); } }); if (Formprint!== "") {//-----------2. Save successfully before opening openprint (Formprint); }} function Openprint (formprint) {//popup window is not filtered by Var Mypop=window.open (formprint, "_blank"); try{Mypop.focus (); }catch (e) {} document.location.reload ();//-------------3. Reload the current page after saving successfully} </script >
JS pop-up window prevents interception, breakout blocking, save after opening