Friday, October 5, 2012

jQuery - Add an ajax request indicator to a page in a fixed position for debug purposes

This is a handy code snippet for adding a debug indicator to a page that uses jQuery for ajax requests. The indicator appears as a little 5px square in the top right hand corner of the page.

  • If the square is grey, then the request is in progress and has not received a response yet.
  • If the square is green then the response was received ok.
  • If the square is red then there was an error (either a timeout or an error response from the server).

No comments:

Post a Comment