Hi,
I'm sure this is really simple, but here is my dilemma. I'm trying to make an
Ajax call to get some response text. However, when I make the call, my "html"
variable is coming up empty. Additionally, my error function is never invoked.
function loadModuleHTML(p_id, p_moduleIndex) {
var html = $.ajax({
type: "POST",
url: "get_file_contents.php",
data: "mod_index=" + p_moduleIndex,
dataType: "html",
error: function(req, errorMsg) {
alert("An error occurred: " + errorMsg);
}
}).responseText;
alert(html); // This always returns a blank alert
box.
document.getElementById(p_id).innerHTML = "<div
class=\"sortListInner\">" + html + "</div>";
} // loadModuleHTML
$().ready(function() {
loadModuleHTML('li0', 0);
});
If I hard code the URL "mydomain.com/get_file_contents.php?mod_index=0" into my
browser, I get valid HTML returned. Any ideas what's going on?
Thanks, - Dave
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/