jQuery :: How to get Ajax readyStates?

jQuery :: How to get Ajax readyStates?

Hi all,
I have some problems with getting jquery $.ajax(); readyStates value.
I used this:
  1. var xhr, jqXHR;
  2. xhr = $.ajax({
  3.     url: ajaxurl,
  4.     cache: false,
  5.     beforeSend: function(jqXHR){
  6.         jqXHR.onreadystatechange=stateChanged();
  7.     },
  8.     success: function(html){
  9.         //some codes..
  10.     }
  11. });
  1. function stateChanged()
  2. {
  3. alert(xhr);
  4. alert(xhr.ReadyState);
  5. alert( jqXHR.ReadyState);
  6. }
stateChanged function always return undefined.
Can Anybody help me?

Thank you
Bahram0110