main = { /** * @description * Xoa tat ca anh cua mot bai viet * */ removeAll:function(){ $('.removeAll').click(function(){ id = $(this).attr('data'); token = $('_token').val(); $('#'+id).html(''); $.ajax({ type: "post", url: "/removeAll", dataType:"json", headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, data:{ id:id, }, success: function(msg) { console.log('vao day'); console.log(msg); $(location).attr('href',msg.url); }, error: function (request, error) { } });//End ajax }) } } $(function(){ main.removeAll(); })