The key to this working properly is to ensure that the server is returning its response with an XML mime type.
In PHP do this: <?php header('Content-type: text/xml'); ?> In JSP do this: <[EMAIL PROTECTED] contentType="text/xml"%> In CF do this: <cfheader name="Content-Type" value="text/xml"> Mike On 5/22/07, Danbh <[EMAIL PROTECTED]> wrote:
Hey everyone, I'm trying to use the jQuery.ajax function, to fetch a webpage on which I would like to run some jQuery on that page. The problem that I am running into is that dataType field. I am setting it to xml, but ajax keeps returning text. Here is the code: XML_page = jQuery.ajax({ //get the whole page via ajax url: "", data: 'q='+mucie_get_q(), async: false, dataType: "xml", }); XML_page.responseXML will be equal to null, but .responseText will contain the document. I've also tried converting responseText to something useful, using jQuery(responseText), but that hasn't worked for me either. When I try to find/select by id, i get "this.getElementsByTagName is not a function" Any advice for the problems that I am running into, either getting ajax to return a DOM, or converting the string to a DOM? Thanks, Dan