Closed SamMousa closed 8 years ago
How do you want to handle these events?
Assuming you mean the generic events I referred to? Those can just be consumed in javacript:
$(document).trigger(eventName, params);
$(document).on(eventName, function(e, param1, param2) {
});
If you're writing JavaScript for it, why not to implement click handler in the first place? I don't think that's a good idea.
Currently the framework provides some unobtrusive scripting to make life easier:
<a href="/test" data-method="post">Cool post link</a>
will post the parent form, or create a new form and post that when the link is clicked. When creating more advanced application, feedback could also arrive through other channels (shared web workers, EventSource, WebSockets, COMET), for those cases the request should be done as AJAX and it's response should throw generic events.I propose some new values for
data-method
:ajaxPost
andajaxGet
. The logic behind these is as follows:success
event.fail
event.Since there is currently no defined behavior for those values the only users that could experience issues are people that have JS that uses the exact same values as mentioned above for the
data-method
field.