469,276 Members | 1,898 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,276 developers. It's quick & easy.

error in ready state

omerbutt
638 512MB
hi there i am getting error in the statechange function .I am using html,ajax,php and mysql,it was running smooth and at once it started giving error here is the code
Expand|Select|Wrap|Line Numbers
  1. function prof_info(fobj){
  2.         var vld_inp=Get_Prof_Info(fobj,"validate");
  3.         xmlHttp=GetXmlHttpObject();
  4.         if(xmlHttp!=null){
  5.             xmlHttp.onreadystatechange=StateChangeA;
  6.             xmlHttp.open("POST","prof_save.php",true);
  7.             xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  8.             xmlHttp.send(vld_inp);
  9.         }
  10.         else{
  11.             alert("your browser is not supported Please Upgrade it ");
  12.             return false;
  13.         }
  14.     }
  15.     function StateChangeA(){
  16.         alert("ready");
  17.         if(xmlHttp.status == 200){
  18.             if(xmlHttp.readyState == 4){
  19.                 var str="";
  20.                 str=xmlHttp.responseText;
  21.             }
  22.         }
  23.     }
  24.  
the error code that i am getting is here

Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://server/rageprojects/myrage/site/edit_account.php :: StateChangeA :: line 46" data: no]
Source File: http://server/rageprojects/myrage/site/edit_account.php
Line: 46

the error is on the line where i have the if (xmlHttp.status == 200)
where as the php file from which it is getting the response is here
Expand|Select|Wrap|Line Numbers
  1. include("config.php");
  2.     $firstname=$_POST["member_first_name"];
  3.     $lastname=$_POST["member_last_name"];
  4.     $email=$_POST["member_email"];
  5.     $country=$_POST["members_country"];
  6.     $city=$_POST["member_city"];
  7.     $url=$_POST["member_url"];
  8.     $memberaim=$_POST["member_Aim"];
  9.     $mem_aboutme=$_POST["member_aboutme"];
  10.     $mem_male=$_POST["member_male"];
  11.     $mem_fmale=$_POST["member_female"];
  12.     $mem_tel=$_POST["member_n_tel"];
  13.     $mem_show_age=$_POST["show"];
  14.     $mem_nshow_age=$_POST["n_show"];
  15.     echo $firstname;
  16.  
Mar 25 '08 #1
6 1979
acoder
16,027 Expert Mod 8TB
You probably need to check if readyState is 4 before you check the status.
Mar 25 '08 #2
omerbutt
638 512MB
You probably need to check if readyState is 4 before you check the status.
yeah i noticed that thing when i posted my question and fixed it ,thanks for the help anyways :)
reagrds,
omer
Mar 25 '08 #3
acoder
16,027 Expert Mod 8TB
So it's working now?
Mar 25 '08 #4
omerbutt
638 512MB
So it's working now?
yeah perfectly buddy :)
Mar 25 '08 #5
acoder
16,027 Expert Mod 8TB
Glad to hear it. I did think based on your reply, but just making sure.
Mar 25 '08 #6
omerbutt
638 512MB
Glad to hear it. I did think based on your reply, but just making sure.
:) thanks a lot for the concern man
regards,
omer.
Mar 26 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by David Berry | last post: by
reply views Thread by Morten Gulbrandsen | last post: by
12 posts views Thread by Christian Christmann | last post: by
reply views Thread by Mike Grishaber | last post: by
1 post views Thread by Sammy | last post: by
1 post views Thread by Eric | last post: by
1 post views Thread by yasoof0wnz | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.