jquery - window.close() in success function -
i have typical ajax post type success function. have tried in many different ways close window on success. after message revealed , can read.
$.ajax({ type:"post", url:"file.php", data:info, success:function(){ $('#load').empty(); $('#information').html('thank you!'); \\settimeout('window.close()',2000); \\ } }); return false;
page opened "window.open()"
try
settimeout(function(){window.close();},2000);
you can reference window:
var wind = window.open();//then settimeout(function(){wind.close();},2000);
Comments
Post a Comment