hi,i'm using a same ajax script more than once in my page.
wonder,how can i make it to display the result in different <div>
such as when user click on button 1,it will display info in div 1.
when user click on button 2, it will display info in div 2.

below is the script i using....

ajax.js
Code:
function loadScript(scriptURL)
{
	var newScript = document.createElement("script");
	newScript.src = scriptURL;
	document.body.appendChild(newScript);
}

function loadData(URL)
{
// Create the XML request  
	xmlReq = null;
	if(window.XMLHttpRequest) 		xmlReq = new XMLHttpRequest();
	else if(window.ActiveXObject) 	xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
	if(xmlReq==null) return; // Failed to create the request

// Anonymous function to handle changed request states
	xmlReq.onreadystatechange = function()
	{
		switch(xmlReq.readyState)
		{
		case 0:	// Uninitialized
			break;
		case 1: // Loading
			break;
		case 2: // Loaded
			break;
		case 3: // Interactive
			break;
		case 4:	// Done!
		// Retrieve the data between the <quote> tags
			doSomethingWithData(xmlReq.responseXML.getElementsByTagName('quote')[0].firstChild.data);
			break;
		default:
			break;
		}
	}

// Make the request
	xmlReq.open ('GET', URL, true);
	xmlReq.send (null);
}
in the index.php
Code:
<script language="JavaScript" src="ajax.js"></script>
<script language="JavaScript">

function doSomethingWithData(str)
{
	document.getElementById('div1').innerHTML = str;
	document.getElementById('div2').innerHTML = str;//original not contain in the tutorial
}
</script>

<div id="div1"></div>
<div id="div2"></div>//original not contain in the tutorial
<input type="button" value="view div 1" onclick="loadScript('stuffindiv1.js')">
<input type="button" value="view div 2" onclick="loadScript('stuffindiv2.js')">