Created
June 7, 2012 18:53
-
-
Save cam-gists/2890768 to your computer and use it in GitHub Desktop.
AJAX: Split Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************ | |
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