zoukankan      html  css  js  c++  java
  • 异常记录

    要兼容 IE8,9,最高可使用 jquery 1.9.1,比它高的版本则不支持 ;且使用

    Bootstrap v3.3.4 时,需要jquery版本 1.9.1 或以上。

    在使用 $.ajax({
                  url: remoteBaseAddress + url,
                  data: jsonStr,
                  type: 'POST',
                  dataType: "json",
                  crossDomain: true,
                  contentType: 'application/json; charset=utf-8',
                  success: function (data) {
                      alert("ok");
                  },
                  error: function (data)
                  {
                      alert(data); // 在IE9,会报 No Transport,可使用 angularjs(1.x)的 $http.post 替换 $.ajax 解决问题。
                  }
              });
    ==============================================================================================================

    在 asp.net mvc4 中加入 wcf 时,碰到 endpoint not found 问题时,则需要如下改动:

    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    //必须放在routes.MapRoute 之上
    routes.Add(new ServiceRoute("LoginService", new APTS.WCFServices.APTSServiceHostFactory(),
                   typeof(APTS.WCFServices.Implementations.LoginService)));
     
    routes.MapRoute(
                          "Default",
                         "{controller}/{action}/{id}",
                         new { controller = @"Home", action = "Login", id = UrlParameter.Optional },
                         new[] { "APTS.Controllers" ,"Permission.Controllers"}
                    );
    ================================================================================================================

    HTTP/1.1 415 Cannot process the message because the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'

    需要在 web.config 设置:

    binding="webHttpBinding" 和 <webHttp/>


     
    
    
  • 相关阅读:
    iOS UI控件7(UITableView)
    iOS UI控件6
    iOS UI控件5-UIPickerView
    iOS UI控件4
    iOS UI控件(3)
    iOS UI控件(2) UITextView
    iOS UI控件(1)
    C# 解决上位机串口接收数据丢失问题
    C# 串口操作系列(3) -- 协议篇,二进制协议数据解析
    如何将Debug文件夹下的资源打包成一个EXE文件直接执行
  • 原文地址:https://www.cnblogs.com/yipeng-yu/p/5113844.html
Copyright © 2011-2022 走看看