Skip to Content
Former Member
May 20, 2016 at 12:58 PM

Loading in an external js library using a destination in the Hana Clould Platform


Hi all

I have the following problem.

In my app I would like to request an external JavaScript file (resource) located within another app in the HANA Cloud Platform. The App that this file is located in has been configured to have no authorization in the neo-app.json file. The file can therefore be accessed publicly and authorization is not an issue.

I have also made a destination in the HANA Cloud Platform that points to this app.

Can one write JavaScript to access this resource using the destination that I have created?

The reason I want to use a destination is because by just using the jQuery.registerResourcePath() and sap.ui.define() methods I get a cross domain request error. Using a destination might be a solution as it acts as a proxy and allows one to avoid getting the cross origin request error.

I cannot just make a script tag in the index.html as when the App is deployed to the Fiori Launchpad I cannot manipulate an .html file to include the script tag and therefore do a get request to fetch the external resource.

Thanks Theo.