Reason
Reason
  • 发布:2015-06-03 18:28
  • 更新:2019-06-03 17:25
  • 阅读:11422

mui.ajax 、mui.post等header设置

分类:MUI

貌似mui的.ajax() .post()方法不能设置header。
如果有的话,怎么去设置呢?

出现一个
No 'Access-Control-Allow-Origin' header is present on the requested resource.
的异常。~~

2015-06-03 18:28 负责人:无 分享
已邀请:
DCloud_UNI_FXY

DCloud_UNI_FXY

你那个错误是跨域吧。
在5+中一般不存在跨域问题。如果你是在普通浏览器上,那目前暂不支持跨域操作。

mui.ajax({  
headers:{  
...  
}  
})
  • Reason (作者)

    好的,谢谢。。。看api中没有header这个参数啊~~

    2015-06-05 09:21

大树哥

大树哥 - 有没有iOS的兼职

http://www.html5plus.org/doc/zh_cn/xhr.html

http://dcloudio.github.io/mui/javascript/#ajax

headers这个参数,我找了所有的api和文档,都没看到,差点就看源码了。

好朋友,加一个嘛。

白师弟

白师弟

具体查看一下 HTTP content-type可能找到你想要的相关设置:
https://www.runoob.com/http/http-content-type.html

该问题目前已经被锁定, 无法添加新回复