View Single Post
Old 03-07-2008, 05:26 PM   #13 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 192
falsepride is on a distinguished road
Code:
xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if(xhr.readyState == 4) { document.write(xhr.status); if(xhr.status == 200) document.getElementById('uhuh').innerHTML = xhr.responseText; else document.getElementById('uhuh').innerHTML =" Error code " + xhr.status; } }; xhr.open("GET", 'test.txt', false); xhr.send(null); document.write(xhr.responseText);
is what i have so far. the ready state change part is just there. for some reason my status returns 0. so i just added the last bit it. yea i should probably note then when i make pages for testing something out, i use random things like 'uhuh' the above script works for reading the .txt file. now im going to replace the .txt file with a php page to search my sql database, then some javascript and i should be good to go. woo!

and dj i dont understand the mistake being made
__________________
falsepride is offline   Reply With Quote