CLIENT GUI Framework
[vnfsdk/refrepo.git] / portal-common / src / main / webapp / common / thirdparty / zTree / api / cn / setting.async.contentType.html
1 <div class="apiDetail">\r
2 <div>\r
3         <h2><span>String</span><span class="path">setting.async.</span>contentType</h2>\r
4         <h3>概述<span class="h3_info">[ 依赖 <span class="highlight_green">jquery.ztree.core</span> 核心 js ]</span></h3>\r
5         <div class="desc">\r
6                 <p></p>\r
7                 <div class="longdesc">\r
8                         <p>Ajax 提交参数的数据类型。<span class="highlight_red">[setting.async.enable = true 时生效]</span></p>\r
9                         <p>默认值:"application/x-www-form-urlencoded"</p>\r
10                 </div>\r
11         </div>\r
12         <h3>String 格式说明</h3>\r
13         <div class="desc">\r
14         <p> contentType = "application/x-www-form-urlencoded" 可以满足绝大部分请求,按照标准的 Form 格式提交参数</p>\r
15         <p> contentType = "application/json" 可以满足 .Net 的编程需要,按照 JSON 格式提交参数</p>\r
16         </div>\r
17         <h3>setting 举例</h3>\r
18         <h4>1. 设置 Ajax 提交参数的数据类型为 JSON 格式</h4>\r
19         <pre xmlns=""><code>var setting = {\r
20         async: {\r
21                 enable: true,\r
22                 contentType: "application/json",\r
23                 url: "http://host/getNode.php",\r
24                 autoParam: ["id", "name"]\r
25         }\r
26 };\r
27 ......</code></pre>\r
28 </div>\r
29 </div>