javascript - Detecting when jQuery trigger finished -


$('input').trigger('input') 

when above function runs, triggers on inputs. how can tell when events occur result of above action have completed? think asking jquery when method, not entirely certain....

my effort is:

$.when( $('input').trigger('input')).done(    function (x) {       if (!$('#mybutton').hasclass('clobbered') {          submitdata();       }    } ); 

update: thankyou comments, sounds overthinking problem. concerned trigger may operate asynchronously....

$('input').trigger('input') follows sequential execution... given none of handlers async process....

if have async processes out of luck don't have access promises...

if there no async process initiated target handlers next line executed after input handlers fired.

$('input').trigger('input') //do 

so in above case do something part called after handlers called not after async process initiated handlers...


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -