fugix Posted May 28, 2011 Share Posted May 28, 2011 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 Quote Link to comment Share on other sites More sharing options...
fugix Posted May 28, 2011 Author Share Posted May 28, 2011 edit: it cycles through all of the alerts...even the succes alert...so it must be working, however i dont want the other alerts to appear Quote Link to comment Share on other sites More sharing options...
fugix Posted May 29, 2011 Author Share Posted May 29, 2011 figured it out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.