I'd like to deal with the backbone, read the standard documentation, polazil on Habra and other sites, but did not find a normal example that will help to understand the work with this framework. That is, more correctly, some simple moments are clear, but all this is not yet necessary, and the most important thing that interests me is connection with the server — sending data and processing responses from the server.
If on the standard jquery I always hung the event and called ajax like this:
//защита от отправки 2 и более запросов одновременно //на случай если, например, пользователь нажимает 2+ раза на кнопку отправки запроса if (!blockedAjaxRepeat){ $.ajax({ url: AJAX_HOST, type: "POST", dataType: "json", // rq - название модуля, который будем вызывать на сервере // data - данные, которые идут на сервер data: { rq: rq, data: data }, beforeSend: function(){ blockedAjaxRepeat = true; }, complete: function(data){ blockedAjaxRepeat = false; }, success: function(data) { //сервер отправляет json данные // status - статус завершения(0 - ок, иначе - какая-то ошибка) if (data.status == 0){ //действие при успешном завершении } else { //действие если произошла ошибка валидации или другая } } }); } Now I don’t understand how to write it correctly on the backbone, for example, if I write a simple authorization on the site (the login and password fields). If there is any ready-made example, please give a link.