Bug Tracker

Opened 8 years ago

Closed 8 years ago

#7727 closed bug (invalid)

get() always expects xml when used on the local filesystem

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


Let content.html be a html file containing the following html text:

<p>Some paragraph</p><p>Some other paragraph</p>

and consider this line of code:


If used on a web server, everything works fine. But if you test it locally, that is you open files from your filesystem in the browser, it gives the following error: "Junk after document element"

which is because the content of content.html is being parsed as xml, despite the value "html" being passed as dataType to get().

Also, even without passing the "html" dataType parameter, the default "intelligent guess" (which works when served by the web server with mime type text/html) should work and guess it is html, since the file has a .html extension (the browser uses this criterion when deciding whether to parse a file as html or xhtml from the local filesystem), but it fails.

Strangely enough, despite the error (which is an error, not a warning) the rest seems to work; however the error shows that the loaded data is being parsed as XML instead of HTML which can eventually lead to problems.

Change History (3)

comment:1 Changed 8 years ago by Rick Waldron

Owner: set to anonymous
Status: newpending

I rebuilt your issue locally, following your instructions and received no error. Which browser are you getting this error in? I've tested in FF3.6.12

comment:2 Changed 8 years ago by jitter

Probably a duplicate of #4807

comment:3 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.