‘no element found’ in firebug or firefox javascript console (part 2)

I was right. If the server sends a response and the ‘Content-Type’ attribute is ‘text/xml’, you must send at least a root node so the xml parser that is built into Mozilla’s XMLHTTPRequest object doesn’t cak and give you a ‘no element found’ Javascript error.

This could be an issue for those of us who are trying to do the REST thing and send back proper status codes depending on the request method and actions taken by the server. A 204 (Updated) or 205 (Deleted) response cannot, by definition, have any content body, so sending a root node is not an option to get around this error. The server needs to determine if the response is going to have an xml content body and assign the Content-Type on the fly.

4 thoughts on “‘no element found’ in firebug or firefox javascript console (part 2)”

  1. i got a same error wen i try to download and use Spellcheck.com code can u explain me in detail how can i get rid of those things

Leave a Comment

Your email address will not be published. Required fields are marked *