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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -