Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('a[id^="eater"]').live('click', function (data) {
- var eater_id = parseInt($(this).attr('id').slice(5).split('_')[0]); // Идентификатор пользователя, по которому будет запрошена информация
- var day_of_month = parseInt($(this).attr('id').slice(5).split('_')[1]); // День в месяце, когда был сделан заказ
- var month = parseInt(window.location.pathname.slice(-2), 10); // Месяц когда был сделан заказ
- var response = {};
- // ajax обращение к джанго представлению, которое сформирует ответ со списком: ФИО, блюдо, блюдо, блюдо...
- //data.preventDefault();
- $.ajax({
- url: '/history/get_order/',
- type: 'ajax',
- data: {'eater_id' : eater_id, 'day' : day_of_month, 'month' : month},
- // post: {'eater_id' : eater_id, 'day' : day_of_month, 'month' : month},
- success: function(dataFromServer) {
- console.log('try to reach /history/get_order/');
- console.log(dataFromServer);
- // response = dataFromServer;
- },
- error: function(dataFromServer) {
- console.log('POPOVER error', dataFromServer);
- }
- });
- $(this).popover({'placement': 'bottom',
- // 'title' : 'Заказ '+/*ФИО*/response[0]+' от '+day_of_month+'.'+month,
- 'content' : 'Содержимое заказа'});
- $(this).popover('show');
- console.log('Ипать');
- });
Add Comment
Please, Sign In to add comment