Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.
/ ajax-tracking Public archive

Track Ajax requests on a page to determine when it's loaded.

License

Notifications You must be signed in to change notification settings

sumtype/ajax-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ajax Tracking

Script to track Ajax requests on a page to determine when it's done loading. Provides a function to the global namespace, callWhenReadyToGo, that takes a callback function which is called when the window has loaded and there are no pending Ajax requests.

Known Issues

Doesn't always work when the page involves requests made via some higher-level libraries. In general, if the request is performed using the XMLHttpRequest API and concludes (successfully or not) with an onreadystatechange event changing the readyState value of the XHR request to the value of XMLHttpRequest.DONE the tracker understands the XHR request to no longer be pending. If onreadystatechange is not fired, or readyState is not ultimately set to the value of XMLHttpRequest.DONE the tracker will indefinitely consider the request to be pending, so will not consider the page to have ever loaded.

About

Track Ajax requests on a page to determine when it's loaded.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published