javascript - Differentiate between a dangerous redirect and an irrelevant ajax response -


on web page possible send ajax requests , jump page meaning ajax requests irrelevant , aborted browser. return 1 of these jquery ajax requests error handling might be:

readystate = 0 responsetext: "" status=0 

but, note error handler may not invoked. depends when browser aborts request , when user selects go onto page. if invoked invoked above parameters.

here gets juicy. similar response happens when 302 redirect returned ajax request when location set domain. browser (both ie , ff) mangle 302 , invoke error handler same info:

readystate = 0 responsetext: "" status=0 

i know 302 location set domain using fiddler. take fiddler away , see above.

i need able differentiate between

  • ajax requests aborted because user goes page
  • ajax requests aborted because redirects domain

but can't if exact same info both.

any tips? check window object or else in dom? note: can't predict when request return 302. can't see location header server side.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

java - How to create Table using Apache PDFBox -

mpi - Why is MPI_Bsend not returning error even when the buffer is insufficient to accommodate all the messages -