ajaxSetup

Ustawienia wspólne dla wielu wywołań ajax

$.ajaxSetup({
    url      : '/projekty/add.json',
    type     : 'post',
    dataType : 'json',
    error    : function(e){ console.error(e.message); }
});

$.ajax({
    url     : '/projekty/edit.json',   // nadpisuje ust. ogólne
    data    : JSON.stringify({id, name}),
    success : function(resp ){ render(resp); }
});