Jump to content

[SOLVED] Anyone notice anything wrong?


killah

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/165849-solved-anyone-notice-anything-wrong/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.