I'll try to make this as broad as possible (I'm fairly new to working with AJAX) but I digress.
Currently, I have a function that calls different functions - so, getContents() calls getWeather(),getMovies(), etc.
In each of the said getXXXX() functions, there is an AJAX call to some php stuff - then I use a function to go through the data and take what I need - all fine and dandy.
However, only getWeather() executes - the following functions are never called. Below is a snippet of some of the relevant code, I believe the issue is with seperating the AJAX, but I can't be certain and searching hasn't provided me with anything too relevant.
I have tried performing what I need in one function to no avail - if I play with the order the first AJAX function works and the others are never fired.
function getContent(zipcode){
getWeather(zipcode);
getMovies(zipcode);
getPlaces(zipcode);
getMorePlaces(zipcode);
}
Same as getmovies, etc
function getWeather(zipcode){
$.ajax({
url: '/dshbrd/php/weather.php',
data: "zip_code=" + zipcode,
dataType: "xml",
type: 'POST',
async: 'false',
success: parseWeatherXml
});
}
Same as parseMoviesXml,etc.
function parseWeatherXml(xml){
$(xml).find("channel").each(function(){
/*do stuff*/
});
}
I realize this is more or less a 'newbie' question, my apologies if I'm using the wrong words/didn't actually search hard enough. Funny thing is, all the php files are executed on the Network (at least in Chrome) and they are returning relevant data - the issue seems to more or less involve my successes not being evaluated. Well, my first success is, anyway.
Edit: I also should mention, this is in no way the 'final' code - I do eventually plan to do everything with one call and the like, but this bug has certainly perplexed me at this prototype stage.