Skip to Content
May 08, 2020 at 05:12 PM

SAPUI5 iFrame src-Path


Hi everybody,

I have a sapui5-app and I would like to call a html-page using an iframe.

I begin with a start.js. Both files start.js and the viewer.html sitting in the same folder /pdf/web

var oiFrame = new sap.ui.core.HTML({content: "<iframe id='pdfViewer' src='/pdf/web/viewer.html' style='width: 100%; height: 700px;' allowfullscreen='' webkitallowfullscreen=''</iframe>" });

If I use the WEBIDE, the HTML-page is correctly loaded.

However, after deployment, the viewer.html is not found, because the app is loading it from a complete wrong place.

It should be loaded from:

, however it loads from:

How can I feed the correct path into the iframe? Is there a javascript function to retrieve the correct path?

Thank you very much for your help