Javascript to html

Javascript to html

  

Hi All,

Using below code i can able to populate only value('/EMS/img/Pdf.png') instead of image,suppose if i hardcode inside the html <img  src='/EMS/img/Pdf.png''> then i can see the image i am not sure what mistake i did.can anyone suggest

"<script>

 document.getElementById('"+(extension.Id)+"').src = '/EMS/img/Pdf.png';

var png= document.getElementById('"+(extension.Id)+"').src;

alert(png);

document.getElementById('"+(extension.Id)+"').innerHTML = png;



</script>


<html>

<img id='extension' src='extension'> </p></html>"

Hi Ganesh,

This doesn't look like you need any support on doing low-code development in OutSystems?

What is it you try to achive?

Regards,

Daniel

Hi Ganesh,

I agree with Daniel, and from your problem it looks like when you use <img  src='/EMS/img/Pdf.png''> than it loads the image from the server (Browser renders the image by sending subsequent request for image tags) . But you are trying to load by Javascript so find the image tag and set the "src" attribute by appropriate image 

document.getElementById("imageid").src="/EMS/img/Pdf.png";