cancel
Showing results for 
Search instead for 
Did you mean: 

Error while displaying image in SAP UI5

Former Member
0 Kudos

Hi Expert,

I am not getting any image after running the below code:-

<!DOCTYPE HTML>

<html>

  <head>

  <meta http-equi="X-UA-Compatible" content="IE=edge">

  <meta charset="utf-8">

     <script

          id="sap-ui-bootstrap"

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

          data-sap-ui-theme="sap_bluecrystal"

          data-sap-ui-libs="sap.m"

          data-sap-ui-compatVersion="edge"

          data-sap-ui-preload="async" >

    </script>

  

    <script>

  sap.ui.getCore().attachInit(function () {

  var oImage = new sap.m.Image({

  scr: "https://upload.wikimedia.org/wikipedia/commons/9/9f/GEO_Globe.jpg"

  }).placeAt("sample1");

  });

    </script>

  </head>

  <body class="sapUiBody" id="sample1">

  </body>

</html>

Can anyone help me out

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor

src not scr......

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Jun

junwu
Active Contributor
0 Kudos

kindly mark the correct answer.

Former Member
0 Kudos

Hi Gaurav,

Please fix attribute scr to src:

  sap.ui.getCore().attachInit(function () {

  var oImage = new sap.m.Image({

  src: "https://upload.wikimedia.org/wikipedia/commons/9/9f/GEO_Globe.jpg"

  }).placeAt("sample1");

  });

junwu
Active Contributor
0 Kudos

what's point to repeat?