Jump to content

AJAX errors


fugix

Recommended Posts

alright guys this one has me stumped...i have this function

function showFriends()  {

    var xhr; 
if(window.XMLHttpRequest)  {

	xhr = new XMLHttpRequest();
} else if(window.ActiveXObject)  {

	try  {

		xhr = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e)  {

		try  {

			xhr = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e) {}
	}
}	

    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              if(xhr.status  == 200) 
                  alert("success");
              else 
                 alert('Problem with readyState');
         } else {

	alert("Problem with status");
}
    }; 

   xhr.open("GET", "test.txt",  true); 
   xhr.send(null); 
};

just to see if I can grab text from a text file when i click a button...when i click the button is triggers the function correctly, however i receive both status and readyState Problem errors...im not sure if this is because it cant grab the data from the text file or what...any suggestions? thanks

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.