If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

The problem is that the first alert will show up empty, the second alert has the value and len is the correct length. If I remove the first alert, len becomes zero and the second alert is blank. I will admit that the second problem is that I don't have a complete grasp of ajax concepts. So the way I'm going about it could be completely backwards.

Basically I call the run() function when the page is done loading and the run() function will display the value on the page. The reason I don't just display it when readyState becomes 4 is because I need to manipulate it in such a way that I can't do it within that if statement.

Well it seems to work if I remove the len = news.length; line and establish the length in my run() function. I'm going to leave it like this for now, but if anyone reads this post and notices something that I'm doing wrong (ie. where I'm calling my run() function) please let me know

Well it seems to work if I remove the len = news.length; line and establish the length in my run() function. I'm going to leave it like this for now, but if anyone reads this post and notices something that I'm doing wrong (ie. where I'm calling my run() function) please let me know

I'm not sure but I guess that XMLHttpRequest object don't have a 'length' so the script will stop at that line.