title: How to override jQuery's use of XMLHttpRequest in $.ajax?
body: <p>I need to <code>addEventListener</code> to listen for <code>progress</code> event <strong>before</strong> opening the XMLHttp connection (i.e. <code>xhr.open()</code>), but the <code>beforeSend</code> method returns an xhr instance already opened. How would I override it to add the listener properly?</p>
  
  <p>(<a href="https://developer.mozilla.org/En/Using_XMLHttpRequest#In_Firefox_3.5_and_later" rel="noreferrer">Note: You need to add the event listeners before calling open() on the request.  Otherwise the progress events will not fire.</a>)</p>