Skip to content

Instantly share code, notes, and snippets.

@cam-gists
Created June 7, 2012 18:53
Show Gist options
  • Save cam-gists/2890768 to your computer and use it in GitHub Desktop.
Save cam-gists/2890768 to your computer and use it in GitHub Desktop.
AJAX: Split Data
/************************************************************************
Split Data Returned From AJAX
************************************************************************/
$.post('dir/file.php',{ params: params },function(data){
// arrays for each
var attr = [];
for(var j = 0; j < data.length; j++){
for(var index in data[j]){
if(index == "attr"){
// Add to array
attr.push(data[j][index]);
}else{
//do nothing
}
}
}// END for
},'json');// END $.post();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment