cgountanis
6 Nov 2009, 8:57 AM
Using the code below I should get 2 AJAX calls with 2 returns. It seems the last one in line is the one that runs. Is there a way to run the same function with params inline at same time. I am sure you can see the reasons. Depending on the siteType it returns different string. Can someone help me with this please?
var siteType = "";
//testing calling function with return
siteType = '1';
Sample.GetLayers(siteType, function(e, o)
{
console.log(o.result);
});
siteType = '2';
Sample.GetLayers(siteType, function(e, o)
{
console.log(o.result);
});
var siteType = "";
//testing calling function with return
siteType = '1';
Sample.GetLayers(siteType, function(e, o)
{
console.log(o.result);
});
siteType = '2';
Sample.GetLayers(siteType, function(e, o)
{
console.log(o.result);
});