我注意到在API中没有抛出API sap.ui.model.odata.v2.ODataModel中描述的metadataFailed事件。
我创建了一个JSBin来重现这个问题。
http://jsbin.com/vusesuvuge/1/edit?html,console
以下代码在Chrome浏览器中触发metadataFailed,但在任何Firefox浏览器中均无效。有人解决这个问题吗?
<!DOCTYPE html>
<html>
<head>
<script src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js" id="sap-ui-bootstrap"
data-sap-ui-theme="sap_blue_crystal" data-sap-ui-libs="sap.ui.commons"
data-sap-ui-debug="true"
></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>oData and table test</title>
<script>
var url = "http://services.odata.org/V3/Northwind/Northwind.svc/Orders";
var oModel = new sap.ui.model.odata.ODataModel(url).attachMetadataFailed(function(){
alert('fail');
})
</script>
</head>
<body class="sapUiBody">
<div id="uiArea"></div>
</body>
</html>