Bug Tracker

Opened 10 years ago

Closed 9 years ago

#6378 closed bug (invalid)

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" ) {

Change History (1)

comment:1 Changed 9 years ago by addyosmani

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?

Note: See TracTickets for help on using tickets.