Jump to content

AJAX error Messages in Firefox


Ang3l0fDeath

Recommended Posts

Ok well i got a website, its built in AJAX, PHP, MYSQL, DOM mainly with CSS styling.

 

My website works 100 % on OPERA web-browser but for my firefox users they get 2 error messages when it comes to using AJAX.  First i'll let you know this problem happens in the AJAX enabled chatroom, i made it myself.  1st Error happens for posting data to the chat room, happens right when the firefox user hits submit.  2nd Error happens randomly when checking for new chat room post every 10 seconds.

 

I got 2 countdown clocks running while the chat page is open thats why i think Error #2 occurs now and then randomly cause both clocks cross paths and excute fetching data AKA httprequest.  1st Error i can problem solve myself however extra help doesnt hurt.

 

So my major overall question is how to solve the problem with #2, why does this only happen with firefox?  i figure it has something to do with the way firefox handles httprequest, something with the SETheader or keep-alive status of the code.  Note im clueless how to do that stuff but i know enough to guess where my problem is coming from.

Link to comment
Share on other sites

yeah its frsutrating not getting an answer but you're just lazy

thats probably why nobody replied

or perhaps you dont have enough info for someone to help you without having to do your job.

im not a programmer but i usually end up like you, clueless - what i do is search google on what i know.

in your case you know its the httprequest with firefox.

why dont you google httprequest + firefox + opera (your post will probably pop up hehe) but most importatly other might appear to!

 

i know that the requests are made differently from browser to browser, but i can only guess if it has anything to do with your problem seeing you didnt post much more information about it but here's what i use

 

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
var url = "file.php";
var params = "variable="+jsvar;
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");

xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState == 4) {
	if(xmlHttp.status == 200) {
		suck sex
	} else {
		not so much!
	}
} else {
	//error with readyState
}
}
xmlHttp.send(params);

}

 

 

i know there's something going on with the

xmlHttp.open("POST", url, true);

aka bug, so search that too

and next time post more info and dont be lazy

people have their own issues ;)

Link to comment
Share on other sites

Your Right about lazy.

 

I'll go back and check my code for an OR ELSE error section.

However Running Multi request that overlap does cause problems

 

I did try and google the problem with only 1 result that was similar to my own problem which lacked detail as to why the problem occurs, i could copy and paste my code but nearly my whole INDEX page is javascript which DOM builds and loads other pages.  As always i'll find the problem and fix it by myself.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.