Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Ajax Post XMLHttpRequest take long time

Ajax Post XMLHttpRequest take long time

Scheduled Pinned Locked Moved ASP.NET
databasephphtmlsaleshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Immunity18
    wrote on last edited by
    #1

    hello i dont know where i had to post this I have a postonly.html page which send a "POST" xmlhttprequest at register.php my problem is while query is complete (and table is updated) extremly fast(1-2 sec) as i can see my database via Putty.exe Responce of the if(http.readyState == 4 && http.status == 200) { alert(http.responseText); } is takes about 15 sec (so the alert box pop up) anyone knows any suggestion so it would be response faster? (my get method Ajax works fine and fast)

        Customer Account Information 
         
    	function postForm()
    	{
    		//var httppost = new getHTTPObject(); 
    		var url2 = "register2.php";
    		var params = "account=testisok&email=yeah";
    
    		http.open("POST", url2, true);
    
    		//Send the proper header information along with the request
    		http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    		http.setRequestHeader("Content-length", params.length);
    		http.setRequestHeader("Connection", "close");
    		
    		http.send(params);
    		http.onreadystatechange = function() 
    		{
    			
    			if(http.readyState == 4 && http.status == 200) 
    			{
    				alert(http.responseText);
    			}
    		}		
    
    	}
    
    function getHTTPObject() { 
      var xmlhttp; 
    
      if(window.XMLHttpRequest){ 
        xmlhttp = new XMLHttpRequest(); 
      } 
      else if (window.ActiveXObject){ 
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
        if (!xmlhttp){ 
            xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
        } 
        
    } 
      return xmlhttp; 
    
      
    } 
    var http = getHTTPObject(); // We create the HTTP Object 
     
     
     
        Enter customer ID number to retrieve information: 
        Account: 
        E-mail :
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups