use jquery.ajax instead of XHR