Wait until processing of jQuery has completed