XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Problem
Date: 2005-04-06 23:00:56
From: mdchaney
Response to: Problem

<blockquote>I'd like to load an XML/HTML fragment from the server and replace a node in the document by that fragment. That way, I could periodically refresh a specific region of the page.</blockquote>


Use the "responseText" attribute to get at the html as text. Then use "innerHTML" to place it where you want it.


If you don't need HTML, but you're just putting text in, you might also use the simple DOM methods to create a text node, stick it on a paragraph, then put the paragraph where you want it. Put your replaceable text in a div with a unique id so you can find it easily, clean it out and change the text.


No Previous Message Previous Message Move up to Parent Message Up Next Message Next Message

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938