I have 2 identical xhtml-documents which are in html (1st) and xhtml (2nd) extensions. The difference is in extension only.
Using ajax (jQuery 1.4.1) I try to get 1st, but web server (IIS 5.1) sends response with Content-Type: text/html
instead of application/xhtml+xml
. If I try to get 2nd, there are no problems.
For both documents I use $.ajax( {...} ), but I get an error for 1st (in the comments):
$.ajax({
url: url,
dataType: 'xml',
contentType: 'application/xhtml+xml',
success: function(data, ts, theXhr) { ... },
error: function(XMLHttpRequest, textStatus, errorThrown) {
// textStatus = "parsererror"
// errorThrown.lineNumber = 5193
// errorThrown.message = "data is null"
// errorThrown.name = "TypeError"
}
});
---
How to make [any] web server think that the 1st document is a real xhtml?