We'll use the Request.HTML
to update a web page with HTML data. This can be useful when you are receiving data as HTML markup.
First, we create a text file that holds our HTML data. Save this text file in the same location as the HTML document that will contain your MooTools code. For the text file, I used the following markup (and again, feel free to customize your HTML document):
<html> <head> </head> <body> <ul> <li>List item #1</li> <li>List item #2</li> <li>List item #3</li> </ul> </body> </html>
Create a new HTML document that will serve as our web page; it will contain our MooTools code and the following HTML markup:
<body> <a href="#">Click to make the request!</a> <div id="holder"></div> </body>
Create an event handler for the
<a>
element being clicked (which triggers the request).<script type="text/javascript...