Hi, How can I check if the content type is JSON or HTML here (server can return any)? $.post(url, params, function(data) { if (!isDataInJsonFormat(data, this)) { editDialog.html(data); return; }; // Assume JSON console.log('This is JSON=%o', data) });
How should isDataInJsonFormat function look like? Cheers, Dmitriy.