I need to get a value from another page. But I get this error with the following code. How can I fix it?
$(document).ready(function() {
$("[name='submit']").click(function() {
$.ajax({
type: "POST",
data: $(".form-signup").serialize(),
url: "external.asp",
success: function(output) {
alert(output.getResponseHeader("Content-Length"));
},
error: function(output) {
$('.sysMsg').html(output);
}
});
});
});
First, your settings object is not well formed, the
successfunction is not terminated.Edit: Seems that you are using jQuery 1.3.x, if so, the
$.ajaxfunction itself returns the XHR object:For jQuery 1.4+ versions:
Then, when the
successcallback its executed three arguments are passed (success(data, textStatus, XMLHttpRequest)), you need to call thegetResponseHeaderon the XmlHttpRequest object, the third argument: