471,881 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

Alert "fixing" problems?

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 1301
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 YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.