简体   繁体   English

Javascript: contentType: ?1 是什么意思?

[英]Javascript : What does contentType: !1 means?

I have seen in multiple cases where the contentType , cache etc are mentioned as !1 .我曾在多种情况下看到contentTypecache等被称为!1 Haven't seen much documentation for the same.没有看到太多相同的文档。 Can someone tell me what that means?谁能告诉我这是什么意思?

$.ajax({
                 url: url,
                 data: FormData1,
                 cache: !1,
                 contentType: !1,
                 processData: !1,
                 type: 'POST',
                 beforeSend: function() {},
                 complete: function(responseData){
    
                }
              });

contentType is the type of data you're sending, so application/json; contentType 是你发送的数据类型,所以 application/json; charset=utf-8 is a common one, as is application/x-www-form-urlencoded; charset=utf-8 是常见的,application/x-www-form-urlencoded 也是如此; charset=UTF-8, which is the default. charset=UTF-8,这是默认值。

dataType is what you're expecting back from the server: json, html, text, etc. jQuery will use this to figure out how to populate the success function's parameter. dataType 是您期望从服务器返回的内容:json、html、文本等。jQuery 将使用它来确定如何填充成功函数的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM