I have the following code but when I run the code, it returns as undefined. I have no idea why this happens!
function loadServiceXml(){
$.get("/xml/ServiceUrls.xml", function(xml){
return $.xml2json(xml);
});
}
function getMajorGroups(){
//get the base element to be created.
var jsonXmlObject;
jsonXmlObject = loadServiceXml();
var element = $('.item-group-button').first();
}
The response returns the xml file without any issues, and when I break and check the values of the variables using firebug it returns as undefined.