‘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.

Bookmark and Share
Tags: , ,
permalinkRead More CommentComments (4) Catsoftware, web

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

  1. Nim Says:

    Thanks for the info!. This “element not found” error was driving me crazy.
    Greetings from spain

  2. Naveen Says:

    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

  3. John Blackmore Says:

    Thnak you for the info I have not been able to send correct status codes in some instances. This has given me an idea to fix :)

  4. Adrian Says:

    Thanks!

Leave a Reply

CSS Template by RamblingSoul | Tomodachi theme by Theme Lab