【问题标题】:JavaScript ajax postJavaScript ajax 帖子
【发布时间】:2012-11-01 10:10:26
【问题描述】:

当 ajax post.can 任何帮助我如下

未声明纯文本文档的字符编码。如果文档包含 US-ASCII 范围之外的字符,则文档将在某些浏览器配置中呈现乱码。文件的字符编码需要在传输协议中声明或者文件需要使用字节序标记作为编码签名。

谢谢, 拉克什

【问题讨论】:

  • 没有你的代码我们怎么能看到什么问题

标签: javascript jquery


【解决方案1】:

我认为您需要设置您在 ajax 发布配置中调用的 contentType。

【讨论】:

    【解决方案2】:

    尝试以这种方式使用 ajax:

      data = {}
      data['a'] = "aaaa";
      data['b'] = "bbbbbbbb"; 
    
      $.ajax({
          url: "url",
          data: data,
          type: 'post',
          success: function(result){
              //result is the output data sent from server
          },error: function(err){
              // This function will be called if error
          }  
    
      });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-02
      • 1970-01-01
      • 2016-01-30
      • 2021-09-17
      相关资源
      最近更新 更多