-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
21 lines (18 loc) · 912 Bytes
/
README
File metadata and controls
21 lines (18 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
A small class for registering ajax calls and fire events when they are complete. Attempts to mimic the behavior of jQuery's ajaxStart and ajaxStop methods when jQuery is not available or your ajax calls are not registered by jQuery.
ajaxtrack = new ajaxTrack();
ajaxtrack.start_callback = function() {
alert('We will now begin contact with the internet');
};
ajaxtrack.stop_callback = function() {
alert('All calls have completed');
};
var fb_hash = ajaxtrack.register_call(); //creates a new item in the 'active' object with a unique id
//logout with facebook api
FB.logout(function(response) {
ajaxTrack.complete_call(fb_hash); //remove item from 'active' object
});
var tw_hash = ajaxtrack.register_call(); //creates a new item in the 'active' object with a unique id
//logout with twitter api
TW.logout(function(response) {
ajaxTrack.complete_call(tw_hash); //remove item from 'active' object
});