Jump to content

Where is the wrong?


shamsuljewel

Recommended Posts

Hi all

I am trying to do this...

mouse click

$div_id = "running";
<a onClick=\"makeRequest3('invite_success.php','$div_id');\" href='#'>sent invitation</a>

in ajax file

function makeRequest3(url,div_id)
{
//document.write(des_div);
try{
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
	try
	{
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");		
	}
	catch(E)
	{
		xmlhttp = false;
	}
}
if(!xmlhttp && typeof XMLHttpRequest!='undefined')
{
	xmlhttp = new XMLHttpRequest();
}	
xmlhttp.onreadystatechange = populateDIV2(div_id);
xmlhttp.open('GET', url, true);
xmlhttp.send(null);
} 
function populateDIV2(div_id)
{
var MyHttpLoading = '<img src="pic/progressbar_long_green.gif" border="0" alt="running" />';
document.write(div_id);
if(xmlhttp.readyState == 4)
{
	if(xmlhttp.status == 200)
	{
		document.getElementById(div_id).innerHTML = xmlhttp.responseText;		
	}
	else
	{
		alert('There was a problem with the request');
	}
}
else
{
	document.getElementById(div_id).innerHTML = MyHttpLoading; // still working
	//setTimeout('content',2000);
	//document.write("ok");
}
}

but the program doesnot work...only thing I see the progress bar gif(progressbar_long_green.gif)

 

 

Link to comment
https://forums.phpfreaks.com/topic/77806-where-is-the-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.