Skip to main content

Bug Tracker

Side navigation

#7727 closed bug (invalid)

Opened December 08, 2010 12:07PM UTC

Closed December 28, 2010 08:01AM UTC

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.

Attachments (0)
Change History (3)

Changed December 08, 2010 05:55PM UTC by rwaldron comment:1

owner: → 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

Changed December 13, 2010 08:23PM UTC by jitter comment:2

Probably a duplicate of #4807

Changed December 28, 2010 08:01AM UTC by trac-o-bot comment:3

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!