基础

太蠢了,基础都忘记了
JSON.parse('{left:1}').left; //这个是错误的 ,key必须用双引号括起来;
JSON.parse('{"left":1}').left;

//ajax的get是会有缓存的问题;,发送中文的话要使用encodeURI 或者 encodeURIComponent;
//ajax的post没有缓存的,所以不用加时间戳 ,发送中文不需要 encodeURI 或者 encodeURIComponent;
//post的发送格式一般为form(表单形式 encType="application/x-www-form-encoded"), 文本格式为 (text/plain), 上传文件格式为( mutiple/form-data );

  

原文地址:https://www.cnblogs.com/diligenceday/p/3904686.html