Skip to content

Instantly share code, notes, and snippets.

@THEtheChad
Created April 16, 2014 05:15
Show Gist options
  • Save THEtheChad/10810101 to your computer and use it in GitHub Desktop.
Save THEtheChad/10810101 to your computer and use it in GitHub Desktop.
$(document).ajaxSuccess(function(evt, res, req){
console.log(arguments);
var url = req.url || '';
var response = res.responseText || '';
var operation;
operation = /operation=(.+?)\&/i.exec(req.data);
operation = operation ? operation[1] : '';
var data;
if(data = req.data){
var params = {};
data = decodeURIComponent(data);
data = data.split('&');
var i = data.length;
while(i--){
var d = data[i].split('=');
params[ d[0] ] = d[1];
}
}
var relavent = {
url: url,
operation: operation,
response: response,
data: params
};
console.log(relavent);
copy(relavent);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment