killah Posted July 13, 2009 Share Posted July 13, 2009 function GetXmlHttpObject() { var xmlHttp; try { xmlHttp = new XMLHttpRequest(); } catch(e) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch() { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch() { return false; } } } return xmlHttp; } function showUnSaved() { var unSavedXML = GetXmlHttpObject(); if(unSavedXML == NULL) { alert("Browser does not support javascript!"); } unSavedXML.open("GET","Ajax_Launcher.php?viewUnSaved", true); unSavedXML.onreadystatechange = function() { if (xmlHttp.readyState == 4) { document.getElementById("responseTable").innerHTML = xmlHttp.responseText; } } unSavedXML.send(null); return true; } function showSaved() { alert("Writing New Events Table"); var savedXML = GetXmlHttpObject(); if(savedXML == NULL) { alert("Browser does not support javascript!"); } savedXML.open("GET","Ajax_Launcher.php?viewSaved", true); savedXML.onreadystatechange = function() { if (savedXML.readyState == 4) { document.getElementById("responseTable").innerHTML = savedXML.responseText; } } savedXML.send(null); alert("Writing New Events Table 2"); return true; } function delSingle(id) { var singleXML = GetXmlHttpObject(); if(singleXML == NULL) { alert("Browser does not support javascript!"); } singleXML.open("GET","Ajax_Launcher.php?delSingle="+id, true); singleXML.onreadystatechange = function() { if (singleXML.readyState == 4) { document.getElementById("responseText").style.height = "25px"; document.getElementById("responseText").style.border = "1px black dashed"; document.getElementById("responseText").innerHTML = singleXML.responseText; } } singleXML.send(null); return true; } function saveThese() { var saveTheses = document.getElementById("select").value; var theseXML = GetXmlHttpObject(); if(theseXML == NULL) { alert("Browser does not support javascript!"); } theseXML.open("GET","Ajax_Launcher.php?saveThese="+saveTheses, true); theseXML.onreadystatechange = function() { if (theseXML.readyState == 4) { document.getElementById("responseText").style.height = "25px"; document.getElementById("responseText").style.border = "1px black dashed"; document.getElementById("responseText").innerHTML = theseXML.responseText; } } theseXML.send(null); return true; } Does anyone notice anything wrong with this? I have a ajax launcher php file that shows saved and unsaved event's, onclicking the button will change the entire table, but my javascript seem's to not want to work :S Quote Link to comment Share on other sites More sharing options...
celsoendo Posted July 13, 2009 Share Posted July 13, 2009 Use Firebug (extension for Firefox) to debug your code and find the problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.