I am creating a modal website that uses jQuery ajax calls to retieve HTML and load a modal. When running the site locally, the ajax command executes completely and returns results. However, once it is uploaded to the server, the modal does not get filled. I've considered it being because the call is asynchronous and the other commands have completed by the time ajax returns a value, but ajax isn't even returning a value at all. Including an error function lends no clues. Any idea?
-Geates
"I do not offer answers, only considerations."
- Geates's Disclaimer
Code:
function doAJAX(url){
var content = null;
$.ajax({
type: "POST",
url: url,
success: function(response) {
[red]alert(response);[/tt]
content = response;
},
error: function(msg) {
alert(msg);
}
});
return content;
}
var html = doAJAX("something.php");
$("#modal").html(html);
-Geates
"I do not offer answers, only considerations."
- Geates's Disclaimer