Why is AJAX request terminology causing confusion?

  • Context:
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Request
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 1K views
shivajikobardan
Messages
637
Reaction score
54
https://lh5.googleusercontent.com/9QsQWXl9st7BwAufKwea7kxOpXwRzJCEIvN0MWmtaJy9aHgfopZQQ0pYHtcXfoNAJzGbP-x89zFcYwzI7FcZnNlHRI3eezngpJUJq1tPIYpCUImKTqvRlDTjScYf7n0jY9-NoMZLgl9dt-MOLQ
Its explanation-:
https://lh5.googleusercontent.com/CCx_IRo7MJecVwlnMs9nMSIoZ_xfnV1ZGjP8OeXUzrTWmj-njI9SI8B0ULE3RfLyft1LInYv7eWe3hCg-1PxKtQUamiY69mBLQTUewEkYsNtYIIyAxlw5Ik8B6N1mpZcHBy8Yu5N3hk1d_X41A
Confusions(“ie” means my interpretation that i am not sure if is correct or not)-:

1) user clicks invoking an event handler.
i.e when an user event occurs, it makes a javascript call. most likely user event=function call

2) handler's code creates xmlhttprequest object
ie that javascript call creates xmlhttprequest in ajax engine.

3) xhr requests file from server

4) server sends the file.

5)NOW I AM CONFUSED.
the terminologies are confusing me.
like-:
a) xhr fires an event. what does that mean? and why to fire an event? Doesn’t user only fire event? Like clicking,pressing some key etc.

b) you can attach handler function to event. (maybe it is trying to talk about event handler i.e if event->handlerfunction() )..I am not sure.

handler fxn then processes the data and displays it.
 
Physics news on Phys.org
If a user clicks a button, the user interface engine fires an onClick event, which invokes whatever event handler has been attached to it. In this case it means an http request is sent out.
When the result of the http request comes back, the http engine (called xhr in this case) fires an http response event, which in the same fashion invokes whatever event handler has been attached to it. In this case the result is somehow presented in the user interface.
 
Klaas van Aarsen said:
If a user clicks a button, the user interface engine fires an onClick event, which invokes whatever event handler has been attached to it. In this case it means an http request is sent out.
When the result of the http request comes back, the http engine (called xhr in this case) fires an http response event, which in the same fashion invokes whatever event handler has been attached to it. In this case the result is somehow presented in the user interface.
thanks for reply.