hi friends i have an ajax()of jquery that parse the xml file , create array on success and want to return multiple array on callback is it possible if yes then how ? pls guide me guys. this is my example code .
var arr1= new Array();
var arr2=new Array();
var var1,var2;
function parseData(callback){
var cnt=0;
$.ajax({
type:"GET",
url:"test.xml",
dataType: "xml",
success:function(xml){
var tempcategory= new Array(2);
var tempitem=new Array(4);
var1= $(xml).find('var1').text();
var2= $(xml).find('var2').text();
$(xml).find('result').each(function(){
var Id = $(this).find('id').text();
var Name = $(this).find('name').text();
tempcategory[0]=catogoryId;
tempcategory[1]=catogoryName;
arr1[cnt]=tempcategory;
$('#output').append("<br/>"+categories[cnt]);
cnt++;
});
callback.call(null,var1);
error: function(){
alert("An error occurred while processing XML file.");
}
});
}
now in this code there is a line callback.call(null,var1);
In this i m returning only 1 variable but like that i have array and some other variable also how can i return that all array and variable togather and if not is there any other way to return multiple array.
thanks