2012-10-27 37 views
5

以外的所有瀏覽器的作品以下Ajax調用適用於除IE10以外的所有瀏覽器(除非我將其設置爲IE9標準模式) 我看着它與提琴手,它看起來好像參數不是在ie10中通過任何想法?jQuery的Ajax調用除了ie 10

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) 
+3

你能提供小提琴嗎? –

+0

你想要哪個部分? – DeniroSA

+2

你有沒有安裝「免費下載管理器」插件(或任何類似的插件)?已知會導致此問題(即使您在IE的管理加載項中禁用它)。 – EricLaw

回答

4

這似乎是在用jQuery的IE10中的錯誤(至少在Windows 7預覽版)。 POST數據不會在請求被髮送,我已登錄的bug細節jQuery的:http://bugs.jquery.com/ticket/12790#comment:18

UPDATE:對我來說,那是在免費下載管理器,在IE10引起問題的錯誤。他們有fixed the issue(3.9.2版本1281 - 2012年12月26日),以便它玩的很好。如果您閱讀上述jQuery鏈接中的註釋,您可以看到有人也選擇了該註釋,並卸載FDM以更正此問題。所以這不是IE10或jQuery的問題,而是附加組件改變正常行爲。

+0

「免費下載管理器」是一款瀏覽器插件還是單獨的軟件? – JustinJason

+0

@JustinJason:FDM是一個單獨的軟件(http://www.freedownloadmanager.org/),雖然它還安裝了一個附加組件來與IE集成,比如攔截下載請求和鏈接點擊。正是這個插件干擾了IE10中的AJAX調用。 – BrutalDev

2

在我的情況下,Download Accelerator Plus是原因。卸載DAP解決了問題。

1

我知道這個問題被問了很久,但想要添加我的答案。

這不是IE或jquery的錯誤。某些下載管理器如DAP,FDM和IDM負責解決此問題(即使禁用時)。刪除這些下載管理器將工作。

的問題是,這些下載器具有一定的URLmon接口的不完整的thunk,這用POST上傳干擾。

很少有人還報告說Google Gears也對此問題負責。 (未經測試)

0

在ajax請求中發送每個POST的數據在IE10中不起作用(即使在我的情況下沒有安裝可能會干擾IE10的其他程序)。在ajax請求中爲每個GET發送數據,而不是爲我工作。

首先,根據JavaScript錯誤控制檯,這似乎是一個jQuery的問題和JSON數據(如錯誤的編碼或非法字符或無效的json),分別在迴應json數據時,但所有JSON數據很好。然後我發現POST數據沒有發送,我將jquery $ .ajax調用中的「type」參數更改爲「GET」,這解決了問題。

0

我在IE10/jQuery 1.11.1中的FormData對象的Ajax POST請求中遇到同樣的問題。 POST數據和文件附件都沒有發送到服務器。僅發送了URL參數。

我使用這個補丁的進度回調添加到jQuery的阿賈克斯:

https://github.com/englercj/jquery-ajax-progress

不要求完美的作品在IE10補丁。

該修補程序在所有其他瀏覽器中都能很好地工作。