about ajax

can you refereed any sample code on AJAX implementation
for On-change action for input text it should interact with database before submit the through submit button


New member
Error while running the application in India

We are facing one issue in Encyclopedia application, it runs successfully in Genève but in India it gives one JavaScript error is thrown but internally it has some environment specific problem .We have also deployed the local code base war file into DEV server (Geneve) it runs without any errors. Even the database is same for local and Development Server-Encyclopedia application (Geneve).

Technologies used are Java 1.6, Grails, Groovy, GORM and EXTJS(as User Interface), Spring Tool Suite(IDE).

A java script error is thrown as ”An unknown error occurred. If the error persists, please contact the support team”.

And after this error if we click on any links or buttons it gives another java script error as "product.isCategorizationDirty is null or not an object”.

Would like to share some investigations:
1) When I have alerted the response.status it displays as “-1”.
2) The code base is same which was running successfully in Genève without any errors.
3) It is able to connect the database and fetch values but not sure whether it is able to fetch all values or there is any connection timeout.
4) Local war file runs successfully on the Development server (@ Genève).

Kindly help us if you can because we are stuck with this problem for the last 3 days.



New member
I did not get you what are you saying?
Is this you needed

function display_data() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
document.getElementById("suggestion1").innerHTML = xhr.responseText;
} else {
alert('There was a problem with the request.');