Something else I just noticed when looking over your code again is that you are only creating one instance of AJAX for the whole page. I think you need to re-work your code so that there are not so many functions and so that there is a new AJAX instance created for each AJAX process.
Code:<input type="button" class="link" value="Create/Edit Users" onclick="doAJAX('users');"/><br/><br/> <input type="button" class="link" value="Create/Edit Test" onclick="doAJAX('tests');"/><br/><br/> <input type="button" class="link" value="Unlock Test" onclick="doAJAX('unlock');"/><br/><br/> <input type="button" class="link" value="Grade Test" onclick="doAJAX('grade');"/><br/><br/> <input type="button" class="link" value="View Active Test" onclick="doAJAX('active');"/><br/><br/>Code:function createRequestObject() { var ro; try {ro = new XMLHttpRequest();} catch(e) { try {ro = new ActiveXObject("Msxml2.XMLHTTP");} catch(e) { try {ro = new ActiveXObject("Microsoft.XMLHTTP");} catch(e) { alert("Your browser does not support AJAX!"); return false; } } } return ro; } function doAJAX(action) { var http = createRequestObject(); var url; if (action == 'users') {url = 'rpc/users.php?rand=' + Math.random();} else if (action == 'tests') {url = 'rpc/tests/main.php?rand=' + Math.random();} else if (action == 'unlock') {url = 'rpc/unlock.php?rand=' + Math.random();} else if (action == 'grade') {url = 'rpc/grade.php?rand=' + Math.random();} else (action == 'active') {url = 'rpc/active.php?rand=' + Math.random();} http.open('get', url); http.onreadystatechange = function() { if (http.readystate == 4) { document.getElementById('admin_box').innerHTML = http.responseText; } } http.send(null); }




Reply With Quote