jQuery的Ajax调用适用于所有的浏览器,除了即10 [英] Jquery Ajax call works in all browser except ie 10

查看:225
本文介绍了jQuery的Ajax调用适用于所有的浏览器,除了即10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了IE10所有浏览器下面的AJAX调用工作(除非我将其设置为IE9标准模式) 我看它与小提琴手,似乎好像paramater没有被通过IE10中的任何​​想法?

  VAR ParamArray参数='{ID:1};

 $阿贾克斯({
        键入:POST,
        的contentType:应用/ JSON的;字符集= UTF-8,
        数据类型:JSON,
        网址:/assets/services/coreWebServices.svc/GetCategoriesWithoutColumns,
        数据:ParamArray参数,
        成功:successFn,
        错误:errorFn
    });
 

引发以下错误

 的OperationFormatter无法序列化从消息中的任何信息,因为消息是空的(为IsEmpty = TRUE)。
    在System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(消息消息,对象[]参数)

System.Runtime.Serialization.SerializationException:在反序列化请求消息的机构运作GetCategoriesWithoutColumns错误。该OperationFormatter无法序列化从消息中的任何信息,因为消息是空的(为IsEmpty = TRUE)。
    在System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.MessageRpc.Process(布尔isOperationContextSet)

System.ServiceModel.CommunicationException:在反序列化请求消息的机构运作GetCategoriesWithoutColumns错误。该OperationFormatter无法序列化从消息中的任何信息,因为消息是空的(为IsEmpty = TRUE)。
    在System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(消息消息,对象[]参数)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&安培; RPC)\ u000d \ u000a
    在System.ServiceModel.Dispatcher.MessageRpc.Process(布尔isOperationContextSet)
 

解决方案

这似乎是jQuery中的错误与IE10(至少在Windows 7 preVIEW释放)。 POST数据不会被请求中发送,我已登录的bug细节的jQuery: http://bugs.jquery.com/ticket/12790#comment:18

更新:在我的情况是,在IE10导致一个问题,免费的下载管理器中的错误。他们有固定的问题(3.9.2版本1281 - 2012年12月26日),因此它扮演美观大方。如果你读了jQuery的链接上述意见,你可以看到,有人接了起来太和卸载FDM纠正这个问题,以及。所以它不是IE10或jQuery的一个问题,而是一个附加改变正常的行为。

The following ajax call works in all browsers except IE10 (unless i set it to IE9 standards mode) I look at it with fiddler and it seems as if the paramater isn't being passed through in ie10 any ideas?

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
    });

throws the following error

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)

解决方案

This seems to be a bug in jQuery with IE10 (at least the Windows 7 preview release). The POST data does not get sent in the request, I have logged details of the bug to jQuery: http://bugs.jquery.com/ticket/12790#comment:18

UPDATE: In my case it was a bug in Free Download Manager that caused a problem in IE10. They have fixed the issue (3.9.2 build 1281. - Dec 26, 2012) so that it plays nice. If you read the comments in the jQuery link above you can see that someone picked that up too and uninstalling FDM corrected the issue as well. So it's not a problem of IE10 or jQuery, but rather an add-on altering the normal behavior.

这篇关于jQuery的Ajax调用适用于所有的浏览器,除了即10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆