The built-in JS debugger did not throw an error on the code mentioned above. Or maybe it did, actually, but the error it threw specified a different file and a different line number than that line was in. Go figure.
Thanks.
On 3/14/06, troels knak-nielsen <[EMAIL PROTECTED]> wrote:
hm ... Without trying it out though, it does occur to me that ms
script debugger would be able to track this down ? Did you try that ?
(Not to rub it in or anything...)
On 3/14/06, Ryan Hagan < [EMAIL PROTECTED]> wrote:
> So, basically the entire problem was right here:
>
>
> ajaxResponse.processWhen =
> xmlDoc.getElementsByTagName('ajax')[0].attributes.process
> .value;
>
>
> That works fine in Firefox, but IE needs to use this:
>
> ajaxResponse.processWhen =
> xmlDoc.getElementsByTagName('ajax')[0].getAttribute('process');
>
>
> Thanks to IE's complete lack of meaningful JS error messages (or lack
> thereof), it took me the better part of two days to track this down.
>
>
>
> On 3/13/06, Ryan Hagan <[EMAIL PROTECTED]> wrote:
> >
> > Greetings,
> >
> > I'm having some problems with the responseXML property after running an
> XMLHttpRequest. Find code and response documents below.
> >
> > The problem is that in Firefox, the code works great. But in IE, the
> responseXML property is empty. The responseText property has the entire
> document as a string, but that doesn't help me much. I really need the DOM
> functions in order to parse the response XML document. I've verified that
> the resultant document is a valid XML file by using IE to load the response
> document directly. IE parses the document correctly and displays it as an
> XML document.
> >
> > If I check the headers inside of the callback function in IE, it properly
> tells me that the document is "text/xml".
> >
> > I've been working on this all day long and I am no closer to solving this
> than when I started. I'm begging for help. Thanks.
> >
> >
> >
> >
> > loadXMLDoc = function(url, qs)
> > {
> > // open custom XMLHttpRequest object
> > var req = getXMLHttpRequest();
> >
> > if (req.overrideMimeType)
> > {
> > // override the mime type to set it to XML
> > req.overrideMimeType("text/xml");
> > };
> >
> > // loop over the qs object and create a string
> > for( myItem in qs )
> > {
> > url += '&' + myItem + '=' + qs[myItem];
> > }
> >
> > // open the request
> > req.open("GET", url, true);
> >
> > // send the info
> > return sendXMLHttpRequest(req);
> > };
> >
> > And my callback function looks like this:
> >
> > callback = function(res) {
> > if ( res.getResponseHeader('Content-type') == 'text/xml' ||
> res.getResponseHeader('Content-type') == 'application/xml' )
> > {
> > log('headers: ' + res.getAllResponseHeaders());
> > log(' res.responsXML: ' + res.responseXML);
> > log('res.responsText: ' + res.responseText);
> > log('Parse Error?: ' + res.responseXML.parseError);
> > var xmlDoc = res.responseXML;
> > var ajaxResponse = new Object();
> >
> > ajaxResponse.processWhen =
> xmlDoc.getElementsByTagName ('ajax')[0].attributes.process.value;
> > ajaxResponse.html = xmlDoc.getElementsByTagName('html');
> > ajaxResponse.json = xmlDoc.getElementsByTagName ('json');
> > ajaxResponse.js = xmlDoc.getElementsByTagName('js');
> >
> > // call original
> > if (!MochiKit.Async.freezeAll) {
> > this._callback(ajaxResponse);
> > }
> > }
> > }
> >
> >
> > And here's my response document (it's a php file):
> > <?php
> > header("Content-type: text/xml");
> > echo '<?xml version="1.0" encoding="iso-8859-1"?>';
> > ?>
> > <ajax process="delayed">
> > <html output="mydiv">
> > <strong>Hello World!</strong>
> > </html>
> > <js></js>
> > <json></json>
> > </ajax>
> >
> >
> > The log response looks like this:
> > INFO: headers: X-Powered-By: PHP/4.4.1X-Zend-WinEnabler: 1.2.0Keep-Alive:
> timeout=15, max=88Transfer-Encoding: chunkedContent-Type: text/xml
> > INFO: res.responsXML:
> > INFO: res.responsText: <?xml version="1.0" encoding="iso-8859-1"?><ajax
> process="delayed"> <html output="mydiv"> <strong>Hello World!</strong>
>
>
--
troels
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---
