Home arrow XML arrow Page 2 - XML Responses and AJAX
XML

XML Responses and AJAX


In a previous tutorial we looked at the responseText property of the XMLHTTP Request. This tutorial will focus on the responseXML accessor.

Author Info:
By: Jayaram Krishnaswamy
Rating: 4 stars4 stars4 stars4 stars4 stars / 40
February 27, 2006
TABLE OF CONTENTS:
  1. · XML Responses and AJAX
  2. · A brief explanation of innerHTML
  3. · AJAX returning an XML document
  4. · A Quick look at XMLDOM
  5. · Student Nodes Collection

print this article
SEARCH DEVARTICLES

XML Responses and AJAX - A brief explanation of innerHTML
(Page 2 of 5 )

We will be coming across the innerHTML property of a DOM object often. To understand this property, consider the following script. The document's p tag is grabbed by referencing its Id property using the getElementById() method. Make sure the syntax is correct; it is case sensitive and unforgiving. The next statement writes the innerHTML property of the referenced element as well as the InnerText property. The innerHTML property represents everything referenced by the Id reference including the mark up, that is in this case, The is a: monkey, whereas the InnerText property gets all the text after removing other tags, in this case, This is a:  monkey as shown in the next picture.

 

<SCRIPT LANGUAGE="JavaScript">
function explain(){
     var inT = document.getElementById("two");
document.write(
"inner HTML: " + inT.innerHTML+
"<hr width='40%' align='left'>innerText: "
+ inT.innerText);
               }
</SCRIPT>

<BODY>
<p id="two">This is a:
<b>monkey</b></p>
<input type="button" value="test" onClick="explain()">


blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials