You can try:
$.ajax({ type: "POST", url: "your url goes here", data: "data to be sent", success: function(response, status, xhr){ var ct = xhr.getResponseHeader("content-type") || ""; if (ct.indexOf('html') > -1) {
It mainly uses indexOf as well, but seems more reliable.
Ankit Jaiswal Sep 18 '10 at 11:54 on 2010-09-18 11:54
source share