javascript - Run PHP script in background using jQuery -


so have php takes time runs in background. want code "command executed. invites pending." - , user see end. else in .php script done in background.

i thinking somehow executing jquery , have stop loading script mid-execute of post. , use ignore_user_abort()

here jquery code plan on using:

jquery.ajax({     type: 'post',     data: { ' mypostdata'},     datatype: 'html',     url: 'myphp.php',     success: function (d) { /* commands */ } }); 

the thing i'm missing having stop call after it's called upon, , need append div saying "invites pending."

almost identical jquery's site example:

alert( "initializing..." );   var jqxhr = $.post( "myphp.php", function(data) {   alert( "working..." ); })   .done(function() {     alert( "finished!" );   })   .fail(function() {     alert( "error!!" );   }) }); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -