Skip to main content

Bug Tracker

Side navigation

#6378 closed bug (invalid)

Opened March 30, 2010 12:31PM UTC

Closed October 01, 2010 03:08AM UTC

An error is thrown if the returned document is expected to be valid XML but it is not.

Reported by: tw2080 Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

Additinal check is required to chatch if data.documentElement == null before data.documentElement.nodeName is checked.

Function httpData, line 5351 should be:

if ( xml && data.documentElement && data.documentElement.nodeName === "parsererror" ) {

Attachments (0)
Change History (1)

Changed October 01, 2010 03:08AM UTC by addyosmani comment:1

need: ReviewTest Case
priority: → undecided
resolution: → invalid
status: newclosed

Here are two code examples, one using valid XML and another using invalid XML. Both are using 1.4.2 in it's current form:

Valid XML: http://www.addyosmani.com/jquery/6378/index.html

Invalid XML: http://www.addyosmani.com/jquery/6378/index2.html

Here is the invalid XML example with your change integrated in the jQuery build included as per your suggestion:

http://www.addyosmani.com/jquery/6378/index3.html

and here's another test similar to the above with a blank XML file used as opposed to just valid input.

http://www.addyosmani.com/jquery/6378/index4.html

What I'm seeing in terms of error output is exactly the same regardless of whether we're using the current lines at 5351 or the lines with your changes included. With this in mind, a developer would be able to sufficiently handle the data returned with additional error checks on the front-end if needed.

Could you please re-open the ticket or re-submit with a detailed explanation and code example to demonstrate why your proposal should be integrated and what benefit it would offer?