It's not a secret anymore!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "XMLHTTPRequest Handling HTML Response" Watch "XMLHTTPRequest Handling HTML Response" New topic
Author

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
author
Rancher

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

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60788
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XMLHTTPRequest Handling HTML Response
 
Similar Threads
[B]Error while reading XML from Webserver using Ajax[/B]
Need for XPATH/XSLT
file handling through EJB
DOM of current page?
Using XmlHttpRequest object