Jump to content

Ajax Error In Firefox Only.


MrFish
 Share

Recommended Posts

It works in all the other browsers except firefox. I get this error but I honestly don't know what it means-ERRORThe requested URL could not be retrievedWhile trying to process the request:POST /includes/login.php HTTP/1.1Host: luminaryreport.byethost17.comUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: en-gb,en;q=0.5Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-aliveReferer: http://luminaryreport.byethost17.com/index.phpPragma: no-cacheCache-Control: no-cacheThe following error was encountered: * Invalid Request Some aspect of the HTTP Request is invalid. Possible problems: * Missing or unknown request method * Missing URL * Missing HTTP Identifier (HTTP/1.0) * Request is too large * Content-Length missing for POST or PUT requests * Illegal character in hostname; underscores are not allowed Your cache administrator is webmaster.Generated Tue, 30 Jun 2009 04:06:47 GMT by demil1.byetcluster.com (Lusca/LUSCA_1.0) Ajax script-

function ajaxlogin(){	var ajaxRequest;	if(window.XMLHttpRequest){		ajaxRequest = new XMLHttpRequest();	} else if(window.ActiveXObject){			ajaxRequest = new ActiveXObject("Msxml1.XMLHTTP");		} else {			alert("Your browser broke!");		}	ajaxRequest.onreadystatechange = function(){		if(ajaxRequest.readyState == 4){			document.getElementById("loginbox").innerHTML = ajaxRequest.responseText;		}	}	var username = login.username.value;	var password = login.password.value;		alert(username + " " + password);		ajaxRequest.open("POST", "includes/login.php", "true");	ajaxRequest.send(null);}

Link to comment
Share on other sites

There are two problems with this line:

ajaxRequest.open("POST", "includes/login.php", "true");

  1. true is a boolean value and shouldn't be surrounded in quotation marks
  2. The value should be false if I'm remembering correctly

Link to comment
Share on other sites

According to the headers, there isn't any content-length or content-type. A post request should have both. The reason those are probably left out is because you aren't actually sending any post data, you're just sending null:ajaxRequest.send(null);If you don't have any post data to send, use get instead. Here's an example of the headers from a post ajax request in Firefox for one of my applications:Host: choiceuniversity.netUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: en-us,en;q=0.5Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-aliveX-Requested-With: XMLHttpRequestContent-Type: application/x-www-form-urlencoded; charset=UTF-8Content-Length: 15Cookie: PHPSESSID=07a98955673ddc13181de9131aaa6258Pragma: no-cacheCache-Control: no-cache

Edited by justsomeguy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...