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 Link to comment https://forums.phpfreaks.com/topic/237717-ajax-errors/ 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 Link to comment https://forums.phpfreaks.com/topic/237717-ajax-errors/#findComment-1221613 Share on other sites More sharing options...
fugix Posted May 29, 2011 Author Share Posted May 29, 2011 figured it out Link to comment https://forums.phpfreaks.com/topic/237717-ajax-errors/#findComment-1221753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.