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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.