nano Posted August 20, 2010 Share Posted August 20, 2010 Hello All, I am currently stuck on a problem and haven't got a clue what to search, I've looked at most articles related to 2D arrays and AJAX. Sorry if this is in the wrong section of the forum, it related to JQuery, AJAX but mainly JavaScript 2D arrays. I am using JQuery and want to create an array with error codes and messages. Here is sample XML: <resources> <resource name="errorCode1">Error Message One</resource> <resource name="errorCode2">Error Message Two</resource> </resources> Here is my current AJAX call: $.ajax({ type: "GET", url: "/resource.xml", dataType: "xml", success: function(xml) { $(xml).find('resource').each(function(){ errorCode = $(this).attr('name'); errorMsg = $(this).text(); }); } }); What I am trying to do, somehow, is create an array that stores all error codes and error messages. I then hope to pull back respective errors when searching for particular error codes. Any help is greatly appreciated. Cheers Guys. Link to comment https://forums.phpfreaks.com/topic/211262-creating-2d-array-from-ajax-response/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.