小编典典

jQuery Ajax调用可在除10外的所有浏览器中使用

ajax

以下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.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)

阅读 261

收藏
2020-07-26

共1个答案

小编典典

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

更新
:就我而言,这是免费下载管理器中的错误导致IE10中的问题。他们已修复了该问题(3.9.2内部版本1281。-2012年12月26日),因此效果很好。如果您阅读了上面的jQuery链接中的注释,您会发现有人也选择了该注释,并且卸载FDM也可以解决此问题。因此,这不是IE10或jQuery的问题,而是改变正常行为的附加组件。

2020-07-26