Jump to content

Copied Function And It Doesn't Work


refiking

Recommended Posts

Ok.  So, I have a function that calls a page that worked fine on the first page.  However, when I changed the variable names on the next page, I ran into problems.  Here's the working function:

 

function GetJobDetails(job_id, ProjectName)
{
	document.getElementById("jobdetails").innerHTML = '<div style="text-align:center;"><b style="font-size:14px; color:#0099FF;">Loading...</b><br /><img src="images/LoadingCircle.gif" /></div>';

	xmlHttp=GetXmlHttpObjecthandler();
	if (xmlHttp==null)
	{
	   alert ("Browser does not support HTTP Request");
	   return;
	}

	url = "jobdetails.php?job_id=" + job_id + "&pn=" + ProjectName;
	url = url + "&sid=" + Math.random();

	xmlHttp.onreadystatechange=stateChangedmedia;
	xmlHttp.open("GET",url,true) ;
	xmlHttp.send(null);
}

</script>

 

Here's the non-functioning function:

 


function GetSetDetails(jobid, setid)
{
	document.getElementById("setdetails").innerHTML = '<div style="text-align:center;"><b style="font-size:14px; color:#0099FF;">Loading...</b><br /><img src="images/LoadingCircle.gif" /></div>';

	xmlHttp=GetXmlHttpObjecthandler();
	if (xmlHttp==null)
	{
	   alert ("Browser does not support HTTP Request");
	   return;
	}

	url = "filemanager.php?jobid=" + jobid + "&setid=" + setid;
	url = url + "&sid=" + Math.random();

	xmlHttp.onreadystatechange=stateChangedmedia;
	xmlHttp.open("GET",url,true) ;
	xmlHttp.send(null);
}

</script>

Link to comment
https://forums.phpfreaks.com/topic/179764-copied-function-and-it-doesnt-work/
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.