异常记录

要兼容 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/>


 

原文地址:https://www.cnblogs.com/yipeng-yu/p/5113844.html