We will create an AJAX application from scratch. The application will use two
click buttons to fetch data from a server and display the information in a web
page, without reloading the page itself.
First we create a small HTML page with a short <div> section. The <div>
section will be used to display alternative information requested from a server.
To identify the <div> section, we use an id="test" attribute:
<html>
<body>
<div id="test">
<h2>Click to let AJAX change this text</h2>
</div>
<body>
</html>
The we add two simple
<buttons>. The buttons will call a function call loadXMLDoc(), when they
are clicked:
Whether you're new to XML or already an advanced user,
the user-friendly views and powerful entry helpers,
wizards, and debuggers in XMLSpy are designed to meet your XML
and Web development needs from start to finish.
New features in Version 2010!
W3Schools is for training only. We do not warrant the correctness of its content.
The risk from using it lies entirely with the user.
While using this site, you agree to have read and accepted our
terms of use and
privacy policy. Copyright 1999-2010 by Refsnes Data. All Rights Reserved.