In the code block below, I attempt to make an ajax call ( $.getJSON()) back to my php application which I'm hosting inside AWS elastic beanstalk. The callback function doesn't seem to ever get invoked.. The same code works perfectly when hosted on my local machine.
The page making this call and the ajax page being called are both within the same AWS container, so I wouldn't think this is a cross-origin issue- but since I don't know the inner workings of how AWS hosts these things, I cant be sure if that might be the issue, or if it's something else.
function retrievefollowerdata() {
console.log("entering retrievefollowerdata");
//ajax call to get back a JSON object of *all* the followers in the targeted area + radius
var qopts = {
crowdluv_tid: "<?php echo $CL_ACTIVE_MANAGED_TALENT['crowdluv_tid'];?>",
crossDomain: true,
fromafar: new String(working_targetset.fromafar)
};
resl = $.getJSON('<?php echo CLADDR;?>ajax_getfollowers.php', qopts, function(result) {
console.log("entering callback, received unfiltered result:"); console.log(result);
} );
console.log("exiting retrievefollowerdata, resl="); console.log(resl);
}
In the chrome console, I end up seeing: -Entering retrievefollowerdata -Exiting retrievefollowerdata, resl = {Object}
The console never prints "Entering callback, ..." -- so I assume the callback from the $.getJSON call is never being invoked.
Strangely, the resl {Object} when printed in the console appears to actually contain the data that would be returned by the ajax page. So I don't know if it's a failure making the http request, or with calling the callback...