ContentType controls the Web type output. Whether it is case-sensitive or not?
For example:
Context. Response.ContentType = "Application/json";
Context. Response.ContentType = "Application/json";
Is it the same?
The code that would have been executed completely without problems. Front Code:
$.ajax ({type: "POST", Url:urlajax + "?) Operationtype=add ", Data: $ (formId). Serialize (), success:function (msg) { var obj = Jquery.parsejson (msg ); if (obj. Issuccess = = True) { $.messager.alert (' hint ', obj. MSG, ' info ', saveokcallback); } else { $.messager.alert (' hint ', obj. MSG); } Enablebutton (True); } });
Background code:
Context. Response.ContentType = "Application/json";
When I change the backend code into
Context. Response.ContentType = "Application/json";
, the front desk directly error.! Is this sentence.!
Jquery.parsejson (msg)
No issuccess attribute!
!!
Finally found out the reason is actually a capital and lowercase problems caused by!!
It seems contenttype it is case-sensitive. But I did not find the relevant information!!
Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.
Is contenttype case-sensitive?