function GetData() { var source = new Array(); //calls the xml request in a loop based on the current sources $('#box2View option').each(function() { source.push($(this).text()); }); //console.log(source); for (i = 0; i