I wrote simple Ajax function which you can use to put result of ajax request to any named div on page.
You just include script ajax.js into head and than you can use function javascript getdata() wherever you want in document, all you need is to have named <div> areas, for example like this:
<a href=”#” onclick=”getdata(‘page_to_load‘,’where_to_put_it‘);”>Click here</a>
Here is the simple exmaple of usage (you’ll need file text.php for this, it should output just anything, which will be put into target DIVs):
<head>
<title>Ajax Demo</title>
<script type=”text/javascript” src=”ajax.js”></script>
</head>
<body>
<a href=”javscript:void(0);” onclick=”getdata(‘text.php‘,’content1‘);”>Click here – put it in content box 1</a>
<a href=”javscript:void(0);” onclick=”getdata(‘text.php‘,’content2‘);”>Click here – put it in content box 2</a>
<div id=”content1” style=”border: 1px solid #cccccc;width:640px;height:240px;”>CONT1 </div>
<div id=”content2” style=”border: 1px solid #cccccc;width:640px;height:240px;”>CONT2 </div>
</body>
</html>
















