Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

ajax:Callback function not being called for every readystate change for first request

Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am working with an ajax program.
In that i have defined a callback funtion
but that function is not being called for every readystatechange of the request object for the first request .
but it is working fine from the second request.

function find(start,number){
var nameField=document.getElementById("text1").value;
var starting=start;
var total=number;
if(form1.criteria[0].checked) {"GET", url + escape(nameField)+"�m2="+escape("exact")+"�m4="+escape(starting)+"�m5="+escape(number));
else if(form1.criteria[2].checked) {"GET", url + escape(nameField)+"�m2="+escape("prefix")+"�m4="+escape(starting)+"�m5="+escape(number));
http.onreadystatechange = callback2;

function callback2(){
if (http.readyState == 4) {//request state
var message=http.responseXML;
alert("response is not completed");
alert("request state is :-"+http.readyState);
Posts: 11962
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question to several forums!
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic