Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Javascript Foreach Function Expected (https://www.warriorforum.com/programming/999177-javascript-foreach-function-expected.html)

shammi007 29th September 2014 12:23 PM

Javascript Foreach Function Expected
 
I am using a function which takes a callback paramater to which im passing my own function. I'm however getting the error function expected..
GpsGate.Server.MyService.getTracksByUser(groupName , user.username, getTracksByUser_callback());

function getTracksByUser_callback(result)
{
var responseData = '<response>';
result.tracks.foreach( //error on this line
function addTrack(track) {
responseData += '<track>';
//ommited
responseData += '</track>';
}
);
responseData += '</response>';
response.body = responseData;
}

looking at examples forEach Method (Array) (JavaScript) im unsure why it is not working


All times are GMT -6. The time now is 07:55 AM.