// JavaScript Document /* This is a dynamic ajax query script. It uses the variables, enabling it to work with any page without having to recreate a new query script. Currently this is only for querying data. I am working on one for inserting and updating data also. whichElement and whichLink are defined in the page calling the function. I.E. whichLink = "nameQuery.asp" this is the page making the query to the database. whichElement = "nameList" this is the element where the data will be returned on the original page. this function uses both the "name" attribute and the "id" attribute but could just as easily only use one or the other. -created by krstofer@teamshibby.com. Based off of script found @ w3schools.com */ var xmlHttp function showData() { //this shows the "working" graphic when the query page is retrieving data document.getElementById(whichElement).innerHTML = "

"
xmlHttp=GetXmlHttpObject();
daString = querystring + "&";
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
//the 'whichLink' variable is assigned on the page making the request.
var url=whichLink;
url=url+"?"+daString;
url=url+"sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
//alert(url)//this is used to view the URL being sent to the query page.
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
//document.getElementById(whichElement).innerHTML=xmlHttp.responseText;
var search = xmlHttp.responseText;
var script;
while( script = search.match(/(