I wrote a short convenient function to host JSON.
$.postJSON = function(url, data, success, args) { args = $.extend({ url: url, type: 'POST', data: JSON.stringify(data), contentType: 'application/json; charset=utf-8', dataType: 'json', async: true, success: success }, args); return $.ajax(args); }; $.postJSON('test/url', data, function(result) { console.log('result', result); });
Aram Kocharyan Oct 22 '13 at 11:44 2013-10-22 11:44
source share