469,320 Members | 2,160 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,320 developers. It's quick & easy.

Alert "fixing" problems?

21
Hi, I've been struggling with AJAX for a while and notice that if I add the alert("xxx")
in my code it always makes the code work.

I'm using divs where I put the output from the server and then handling the info from there. Sometimes the JS doesn't find the newly inserted tags (divs with id), only when I add the alert command before it. It's kind of strange. Aswell as when enabling FireBug. So I guess that FireBug and the alert are doing the same things. Any clues somebody?
Apr 4 '07 #1
1 1249
acoder
16,027 Expert Mod 8TB
This is usually caused when not waiting for the response. What the alert does is allow time for the response to be received from the server. All code depending on the response should be called from the callback function when the readyState is 4 and status is 200.
Feb 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Robbie Hatley | last post: by
2 posts views Thread by Gabriele *darkbard* Farina | last post: by
8 posts views Thread by John Nagle | last post: by
94 posts views Thread by Samuel R. Neff | last post: by
4 posts views Thread by Chris Shearer Cooper | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.