Write spec and fix for a jQuery.ajax bug

Reference #2314

Sorry about I mixed other codes to that RP, so send another one and close that.