I have a simple jsp page in which there is an ajax call on an input string which returns the upper case of the string in json. This is working for the first time but not on successive requests. I am using the GET method.
Most likely the Ajax result is being cached; append a random tidbit to your URL, preferably something like timestamp to have a distinct URL for each request to prevent this caching. If you are using an URL like /YourApp/Upper append it with /YourApp/Upper?t=timestamp .
Thing is i want the AJAX request to be sent on each onclick of the button . this is now only happening on the first instance of the click. If I refresh the page then it happens again, else not. This is due to the fact that there is
AJAX.onreadystatechange = handler
where var AJAX has the xmlhttprequest.
Now the ready state is 4 when the data is loaded from the server and since its value is not changing so the handler function is not getting called.So is there any way to change the status after every server response or any other alternate way?