If used asynochronously, what event handler needs to be implemented to get the reply? Does anyone know?
Three answers:
jake cigarâ„¢ is retired
2007-02-16 12:05:14 UTC
coding raw (classic js code) you get 1 callback to do your dom manip.
since we like to think using events that magically get fired off when things have happened. the great libraries have many different events.
ajax starts, all ajax ends, an ajax ends, an ajax error...great events for great programmers!
I use http://jquery.com and throw off ajax request and they call my custom event handlers.... magically... just like one might expect.
sf5987
2007-02-16 08:27:53 UTC
What event handler you use really depends on what you are using Ajax for. For example, if you were validating a password with Ajax, you would want the field to validate everytime the user changes the field; therefore, you would use the onChange event handler. However, if you were doing something that responded to a button, you would use onClick.
2007-02-16 08:17:22 UTC
I'm not sure what you are asking, but generally speaking, you ask for the onreadystatechange from an HTTP request object.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.