 = [];      //add associated link data     for (var j = 0; j < data.links.length; j++) {         linkData = data.links[i];         child.links.push({             latitude: linkData.position.$a,             longitude: linkData.position.ab,             stopNum: i + j,             fileName: linkData.title         });     }     //push to json array     json.push(child); }  //stringify the JSON and post results var results = JSON.stringify(json);