Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify usage of ajax events with .on() #503

Open
dmethvin opened this issue Jun 1, 2014 · 7 comments
Open

Clarify usage of ajax events with .on() #503

dmethvin opened this issue Jun 1, 2014 · 7 comments

Comments

@dmethvin
Copy link
Member

dmethvin commented Jun 1, 2014

The docs don't mention that .ajaxComplete() et al are actually aliases for triggered/triggerable events that can be attached with .on(),

Also, the language on these pages and the http://api.jquery.com/Ajax_Events/ page should be clarified now that the term "global event" doesn't apply. These events are triggered on document only. The Ajax Events page says the error and success callbacks are "local events" but that is confusing nomenclature, they aren't events in the DOM-event sense of the word.

@dmethvin
Copy link
Member Author

dmethvin commented Jun 5, 2014

@kswedberg
Copy link
Member

@dmethvin : Great points. I'm gonna take a stab at updating this page. I was thinking about starting with the true events. Then mention error, success, et al as " callback options". Might as well mention promise methods, too, while we're at it—at least for the order of execution, if that can be determined.

I think we're referring to "global" versus "local" in the sense that global happens for all requests, not in the sense of being able to apply it to any DOM element. Also, $.ajax() has a global setting that turns off these events, so I think it makes sense to continue referring to them as global. Thoughts?

@dmethvin
Copy link
Member Author

dmethvin commented Jun 5, 2014

Using "callback options" sounds good to me. As far as the order of execution of everything, I don't know that we want to define all that. "People shouldn't be mixing promises, callbacks, and events in ways that depend on order," he pontificated. ❓

@kswedberg
Copy link
Member

ok. Do you think it makes sense to still refer to "global events," though, given the global setting?

@dmethvin
Copy link
Member Author

dmethvin commented Jun 5, 2014

I guess we can define "global" as "triggered on the global document object" perhaps?

@arthurvr
Copy link
Member

Great points. I'm gonna take a stab at updating this page.

@kswedberg Are you still interested in taking this (or already working on it)?

@kswedberg
Copy link
Member

@arthurvr : oh boy, I think I've littered this repo with a million little promises like that. I keep thinking I'm going to find time right around the corner, but I discover that I have less and less. Please feel free to take this on if you're willing and able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants