File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes XMLHTTPRequest Handling HTML Response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "XMLHTTPRequest Handling HTML Response" Watch "XMLHTTPRequest Handling HTML Response" New topic

XMLHTTPRequest Handling HTML Response

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Normally, when we send back XML to XMLHttpRequest, request.responseXML will return the parsed DOM tree. Is it possible to retrieve a parsed DOM tree too if we return HTML (content-type: texl/html) instead of XML? For example, my XMLHttpRequest could request a normal HTML page and retrieve a specific tag from it.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
The content type of the page has to be XML

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

Why not return XHTML, which is valid XML, and be done with it?

[Asking smart questions] [About Bear] [Books by Bear]
Consider Paul's rocket mass heater.
subject: XMLHTTPRequest Handling HTML Response
jQuery in Action, 3rd edition