jquery.ajax: improvement for #2688, added test