gpt4 book ai didi

javascript - AngularJS Web API - IE 不发布表单正文

转载 作者:行者123 更新时间:2023-11-28 00:15:22 25 4
gpt4 key购买 nike

当我在 Angular JS(使用 IE 11)中执行 http post 时,OAuthValidateClientAuthenticationContext 表单正文在 ValidateClientAuthentication 中不包含任何数据。

请注意,这与 Chrome 和 Firefox 完美配合。如果我打开调试器并切换到 IE 9,它可以工作,但是当我关闭调试器时,它会切换到 IE 11 并停止工作。

任何想法表示赞赏!

//sample code    
var data = "grant_type=password&username=john&password=mYpass10&client_id=self"

this.$http.post('/token',
data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
.success(function(response: any) {})
.error(function(err, status) {});

最佳答案

将以下内容添加到您的页面可以解决该问题吗?

<meta http-equiv="x-ua-compatible" content="IE=9" >

这显然是微软正在调查的一个错误。查看更多信息:

http://blog.yorkxin.org/posts/2014/02/06/ajax-with-formdata-is-broken-on-ie10-ie11/

Why is IE 10 Refusing to send POST data via jQuery $.ajax

关于javascript - AngularJS Web API - IE 不发布表单正文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30505836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com