Jump to content

Issue with ajax script


Athgar

Recommended Posts

I have an ajax file which I did not write myself which has the following function :

 

http_request.onreadystatechange = function()
{	
	if(http_request.readyState < 4)
	{
		loadElement.innerHTML = '<img src="/images/ajax-loader.gif" alt="Loading" /> Requesting information...';
	} else if(http_request.readyState == 4){

		if(http_request.status == 200)
		{	
			outputElement.innerHTML = http_request.responseText;
		} else {
			outputElement.innerHTML = 'There was a problem with the request.';
		}
	}
}

 

The output of this code is always 'There was a problem with the request' when it is called from php files and I don't know why.  I know very little about Ajax and I haven't been able to find anything pertinent from my own searches.  I'd be very grateful for any advice

Link to comment
https://forums.phpfreaks.com/topic/136081-issue-with-ajax-script/
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.