admin管理员组

文章数量:1353322

I've been trying to get started on building OpenUI5 apps using cordova. The latest issue I am facing is that I can't seem to use my local "resources" folder (where all the OpenUI5 js files are stored). I am running the index.html file on chrome with web security disabled to allow for cross platform calls (as I was getting an error for that when running it on chrome in normal mode).

I even tried running the index.html page using http-server, but that wouldn't display the page, instead only downloading it whenever I tried to access it on the browser.

Now when I try to load the page, chrome's developer tools gives me these errors.

The html page has virtually no code. All I am trying to do is open up a blank page with the title "Hello World".

<html>
<head>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="msapplication-tap-highlight" content="no" />
    <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See  -->
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <!--  -->
    <!--  -->
    <script  src= "./resources/sap-ui-core.js"
       id= "sap-ui-bootstrap"
       data-sap-ui-libs= "sap.m"
       data-sap-ui-theme= "sap_bluecrystal">
    </script>
    <title>Hello World</title>
</head>
<body class="sapUiBody">
    <div id="content" ></div>
</body>
</html>

Any solution as to how I can proceed would be highly appreciated.

PS: The library js files seem to work fine when accessed using the openui5.hana.ondemand/ or sapui5.hana.ondemand/ urls in place of "./resources/"

PPS: The issue persists on the android emulator as well, so it's not a browser issue, I think.

I've been trying to get started on building OpenUI5 apps using cordova. The latest issue I am facing is that I can't seem to use my local "resources" folder (where all the OpenUI5 js files are stored). I am running the index.html file on chrome with web security disabled to allow for cross platform calls (as I was getting an error for that when running it on chrome in normal mode).

I even tried running the index.html page using http-server, but that wouldn't display the page, instead only downloading it whenever I tried to access it on the browser.

Now when I try to load the page, chrome's developer tools gives me these errors.

The html page has virtually no code. All I am trying to do is open up a blank page with the title "Hello World".

<html>
<head>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="msapplication-tap-highlight" content="no" />
    <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache/jira/browse/CB-4323 -->
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <!-- https://sapui5.hana.ondemand. -->
    <!-- https://openui5.hana.ondemand. -->
    <script  src= "./resources/sap-ui-core.js"
       id= "sap-ui-bootstrap"
       data-sap-ui-libs= "sap.m"
       data-sap-ui-theme= "sap_bluecrystal">
    </script>
    <title>Hello World</title>
</head>
<body class="sapUiBody">
    <div id="content" ></div>
</body>
</html>

Any solution as to how I can proceed would be highly appreciated.

PS: The library js files seem to work fine when accessed using the openui5.hana.ondemand./ or sapui5.hana.ondemand./ urls in place of "./resources/"

PPS: The issue persists on the android emulator as well, so it's not a browser issue, I think.

Share Improve this question edited Mar 12, 2015 at 19:31 wanderingProgrammer asked Mar 12, 2015 at 17:56 wanderingProgrammerwanderingProgrammer 1911 gold badge3 silver badges20 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 3

You can see there openui resources library. Take this resources file your www folder. And ı am using ../resources/sap-ui-core.js maybe help you.

If you are trying to run your Sample project in SAP web IDE, In the index.html file of your project, look for the line

src="resources/sap-ui-core.js"

Make it ---->

src="https://sapui5.hana.ondemand./resources/sap-ui-core.js"

This solved my issue. Let me know any other way worked for you.

I

Unfortunately core-ui is just one of the files that you need for OpenUI5.

If using Windows, and due to errors apparently you are, Chrome will not load other Javascript parts from a javascript file. So you needs a Web Server like Apache. Or you can try put this on your Chrome shortcut destination: "C:\Chrome\Application\chrome.exe" --allow-file-access-from-files file:///C:/OpenUI5/sdk/index.html

src= "https://sapui5.hana.ondemand./resources/sap-ui-core.js"
id= "sap-ui-bootstrap"
data-sap-ui-libs= "sap.m"
data-sap-ui-theme= "sap_bluecrystal"

or

src= "resources/sap-ui-core.js"
id= "sap-ui-bootstrap"
data-sap-ui-libs= "sap.m"
data-sap-ui-theme= "sap_bluecrystal">

本文标签: javascriptOpen UI5 sapuicorejs Failed to load resourceStack Overflow