If it has happened that you are testing web application with lots of Ajax calls that makes parts or the whole pages to reload frequently you might find the code snippets below extremely useful.