【发布时间】:2015-01-21 14:38:36
【问题描述】:
我使用 openUI5 作为参考来开发我的应用程序(下载了库并在我的应用程序中引用本地版本) 现在我需要在我的应用程序中引用 sap.viz 库,我认为 sap.viz 不是 openUI5 的一部分。
所以,我开始从远程主机引用库,如下所示:
<script id="sap-ui-bootstrap"
type="text/javascript"
data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.ui.ux3,sap.m,sap.viz"
data-sap-ui-theme="sap_bluecrystal"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js">
</script>
我已经在 SAP MII(基于 Netweaver java)上部署了我的应用程序。
该应用程序在 IE 0 中无法运行,但在 Chrome 中运行良好。当我研究它与CORS(跨源请求)有关。我尝试使用下面的代码定义 Content-security-policy 以忽略这一点,但它没有帮助。
<meta http-equiv="Content-Security-Policy" content="script-src 'self' https://sapui5.hana.ondemand.com"/>
<meta http-equiv="X-Content-Security-Policy" content="script-src 'self' https://sapui5.hana.ondemand.com"/>
我使用http://jsbin.com/cigorepiri/1/edit 创建了示例代码
调试时在 IE10 中收到的错误是
SCRIPT5022: failed to load 'sap/ui/thirdparty/jquery-mobile-custom.js' from https://sapui5.hana.ondemand.com/resources/sap/ui/thirdparty/jquery-mobile-custom.js: 0 - [object Error]
所以,要么我需要一个解决方案来通过 IE10 忽略这一点,要么需要一种下载 sap.viz 库的方法。
请指教。
谢谢 哈里
【问题讨论】:
-
我是兼容性视图设置问题。当我删除该列表主机并取消选中“在兼容性视图中显示 Intranet 站点”复选框时
标签: cors javascript sapui5