JD - Added wait_for_ajax method.