Thanks, Remy. Good to know.
Mike
@Mike - I actually had that same function for a project I was working
on, and IE plain refused to convert it to a DOM that I could work
with.
In the end, I used a bit of substring parsing to get the contents of
the body, and dumped it in a hidden DIV (thus c
@Mike - I actually had that same function for a project I was working
on, and IE plain refused to convert it to a DOM that I could work
with.
In the end, I used a bit of substring parsing to get the contents of
the body, and dumped it in a hidden DIV (thus creating the DOM I
needed):
xml = xml.s
Here's a fn for converting strings to docs:
function stringToDoc(s) {
var doc;
if (window.ActiveXObject) {
doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = 'false';
doc.loadXML(s);
}
else
doc = (new DOMParser()).parseFromString(s, 'text/xml');
r
ps... this may not work in IE!
On 5/16/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:
if the files is xhtml (or xml of some type) and it's being served as
text/html, the browser won't give you a dom.
UNLESS you override the mime-type!
beforeSend : function(req){req.overrideMimeType('text/xml')},
dataTyp
if the files is xhtml (or xml of some type) and it's being served as
text/html, the browser won't give you a dom.
UNLESS you override the mime-type!
beforeSend : function(req){req.overrideMimeType('text/xml')},
dataType: "xml",
inside the $,ajax call.
On 5/16/07, tcollogne <[EMAIL PROTECTED]>
You could try using the dataType option in $.ajax:
$.ajax({
type: "GET",
url: "mypage.php",
data: "id=1",
dataType: "xml"
success: function(msg){
// do something
}
});
The HTML should be valid XML as well (i.e. if you changed the
extension to 'xml' you could open it in IE
6 matches
Mail list logo