DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: FireFox Ajax POST request problem (help greatly appreciated)

  1. #1
    Join Date
    Jul 2008
    Posts
    1

    FireFox Ajax POST request problem (help greatly appreciated)

    Hello, I am new here and somewhat new to using ajax. I have been trying to solve a problem for a few days now and don't know what else to do. I have been scaling down my code to try and get a simple example working but still no luck. My simple ajax post request works fine in IE but in firefox it only reaches the php script about 50% of the time also, 100% of the time the responseText is empty when there should be some text. Finally firefox doesn't seem to recognize the .status variable of the XMLhttprequest object. There are no problems at all in IE but all are present in firefox. Here is the relavent code I have:

    Code:
    function SendValuesTest(url,params) {
    	var http = new XMLHttpRequest();
    /*	if (http.overrideMimeType) {
    		// set type accordingly to anticipated content type
    		//http_request.overrideMimeType('text/xml');
    		http.overrideMimeType('text/html');
    	 }
    */	
    	http.open("POST", url, true);
    	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    	http.setRequestHeader("Content-length", params.length);
    	http.setRequestHeader("Connection", "close");
    	http.onreadystatechange = function() {//Call a function when the state changes.
    		//alert(http.status);
    		 if (http.readyState == 4) {
    				alert(http.responseText);
    		 }
    	}
    	http.send(params);
    	
    }
    http.status and .overrideMimeType are commented out because it didn't seem to recognize those variables

    the php script is just a simply echo statement. Thanks for any help.
    Last edited by stevep; 07-24-2008 at 08:31 PM.

Similar Threads

  1. Replies: 1
    Last Post: 04-17-2007, 02:02 AM
  2. Ajax POST request using ASP.net
    By partyk1d24 in forum ASP.NET
    Replies: 3
    Last Post: 03-30-2007, 10:31 AM
  3. AJAX form tag problem
    By kgarthai in forum AJAX
    Replies: 0
    Last Post: 02-19-2007, 09:31 PM
  4. 1st post (got a problem)
    By c05513 in forum .NET
    Replies: 3
    Last Post: 05-26-2006, 02:13 PM
  5. Soap-Cannot POST request to .asp file
    By Itsu in forum Enterprise
    Replies: 0
    Last Post: 01-29-2001, 04:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center