問題描述
我正在嘗試做這樣的事情(符合 W3,DOM):
I'm trying to do something like this (W3 compliant, DOM):
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest' );
對于 ActiveXObject('Microsoft.XMLHTTP')
和 XDomainRequest
(IE8).我沒有運氣在微軟文檔甚至谷歌的任何地方找到它.知道如何實現這一目標嗎?
For ActiveXObject('Microsoft.XMLHTTP')
and XDomainRequest
(IE8). I'm having no such luck finding it anywhere in microsoft documentation or even google. Any idea how I can achieve this?
推薦答案
參考本帖http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx看第三點3. 請求中不得添加自定義標頭
Referring to this post http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx See the point three 3. No custom headers may be added to the request
您不能將自定義標題添加到 XDR 對象.希望這會有所幫助.
You cannot add custom headers to an XDR object. Hope this helps.
這篇關于在 XDomainRequest 或 ActiveXObject('Microsoft.XMLHTTP') 中設置標頭的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!