Jquery Ajax调用适用于除10之外的所有浏览器

前端之家收集整理的这篇文章主要介绍了Jquery Ajax调用适用于除10之外的所有浏览器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
以下ajax调用适用于除IE10之外的所有浏览器(除非我将其设置为IE9标准模式)
我用小提琴手看着它,看起来似乎没有通过ie10任何想法传递参数?
var paramArray = '{"ID":1}';   

 $.ajax({
        type: 'POST',contentType: 'application/json; charset=utf-8',dataType: 'json',url: '/assets/services/coreWebServices.svc/GetCategoriesWithoutColumns',data: paramArray,success: successFn,error: errorFn
    });

抛出以下错误

The OperationFormatter could not deserialize any information from the Message because the Message is empty (IsEmpty = true).
    at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message,Object[] parameters)

System.Runtime.Serialization.SerializationException: Error in deserializing body of request message for operation 'GetCategoriesWithoutColumns'. The OperationFormatter could not deserialize any information from the Message because the Message is empty (IsEmpty = true).
    at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message,Object[] parameters)\u000d\u000a
    at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message,Object[] parameters)\u000d\u000a
    at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message,Object[] parameters)\u000d\u000a
    at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(Message message,Object[] parameters)\u000d\u000a
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

System.ServiceModel.CommunicationException: Error in deserializing body of request message for operation 'GetCategoriesWithoutColumns'. The OperationFormatter could not deserialize any information from the Message because the Message is empty (IsEmpty = true).
    at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message,Object[] parameters)\u000d\u000a
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)\u000d\u000a
    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

解决方法

这似乎是使用IE10的jQuery中的一个错误(至少是Windows 7预览版). POST数据没有在请求中发送,我已经将错误的详细信息记录到jQuery: http://bugs.jquery.com/ticket/12790#comment:18

更新:在我的情况下,这是免费下载管理器中的一个错误导致IE10中的问题.他们有fixed the issue(3.9.2 build 1281.- 2012年12月26日),所以它很好玩.如果您阅读上面jQuery链接中的注释,您可以看到有人选择了该注释并卸载FDM也纠正了该问题.所以它不是IE10或jQuery的问题,而是一个改变正常行为的附加组件.

原文链接:https://www.f2er.com/jquery/181255.html

猜你在找的jQuery相关文章