Answer the question
In order to leave comments, you need to log in
How to intercept all outgoing XMLHttpReques?
At the moment I'm using
(function() {
var origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
console.log('request started!');
this.addEventListener('load', function() {
console.log('request completed!');
console.log(this.readyState); //will always be 4 (ajax is completed successfully)
console.log(this.responseText); //whatever the response was
});
origOpen.apply(this, arguments);
};
})();
$.ajax({
dataType: "jsonp",
url: "https://api.instagram.com/v1/users/self/feed",
data: {
count: count,
access_token: IG._access_token
},
success: function (json) {
if(json.meta.code===200)
owner.feedBuild(json.data, 'IG');
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question