Hi there.
I have spent the last 4 hours trying to figure this out and I’m about to send the computer flying to the street. But knowing that this would not solve the problem, I come to sitepoint.
I have some issue with AJAX. I am using the standard script that I found in some tutorial a while back, which has been working fine. Suddenly, all hell broke loose. Now I have been modifying the script a bit, but nothing that would obviously break it.
Here is what should happen:
- User action –> javascript initiating the AJAX call to a server script
- Server script (php) processes the information, echo ‘response’
- Back to javascript, if readyState == 4 and status == 200, display ‘response’ in the predefined div on the page through .innerHtml
Here is what happens:
- User action –> javascript initiating the AJAX call to a server script
- Server script (php) processes the information, echo ‘response’
- Back to javascript, if readyState == 0 and status == 0, no response displayed
I simply don’t get it. If there was a parse error of sorts, php would rebel and I would get the error message in the ‘response’ div (happened in the past). The server-side script runs just fine, since I can see its actions reflected in the database. If there was a JS issue, I’d see it come up in the error console, like it usually does.
So, gang, any ideas on what could possibly result in readyState and status being 0???
I am out of ideas, especially because it worked fine earlier today, then stopped working, then came back for about 30 min, then stopped working again.
Another thing: I called tech support of the hosting company - no issues with the server that would cause this that they are aware of.
Any ideas please??? Thank you!
Victor