jQuery ajax zwrócił dane: json i html mix?

Mam to żądanie ajax, aby uzyskać dane z mojego serwera idataType jest zawszehtml domyślnie. Czasami jednak zwraca json z serwera, więc chcę sprawdzić, czy zwrócone dane to html, a następnie wykonać A else wykonaj B. Czy to możliwe?

Mój żart,

 $.ajax({
     type: "GET",
     dataType: "html",
     url: request_url,
     context: $('#meat'),
     async: true,
     beforeSend: function () {},
     success: function (returndata, status, jqXHR) {
         if ($.parseJSON(returndata) === false) A;
         else B.
     }
 });

Otrzymuję ten błąd, gdy zwracane są danehtml,

SyntaxError: JSON.parse: nieoczekiwany znak

Więc jak mogę stworzyć ten kodwszechstronny?

questionAnswers(3)

yourAnswerToTheQuestion