Home > Software engineering >  Display image on Html page
Display image on Html page

Time:01-13

I'm trying to display a static image located in the same folder as my Html file but it seems I can't get the right path for it to display correctly. The application I'm developing is an atlassian plugin that also includes a java backend to get Data from the Database and I'm displaying it on the frontend using HTML and javascript, the whole application runs on a webserver as a Plugin. Both the image and the Html file are located in here: D:\clone4\project\src\main\resources\templates\scheduleraction

The URL path for the web application is:

https://staging.com/jira/secure/SchedulerAction!default.jspa

I tried many ways and this is the last one :

<img src="/SchedulerAction!default.jspa/piechart.jpg" alt="pie-chart">

I need to add the correct path in the "src" so the client can retrieve the image from my Files on the webserver. I would love any hint or help!

enter image description here

CodePudding user response:

you should use exact path like ./Image.png. And avoid using Images out of the static HTML file located directory

CodePudding user response:

Try to use a service to upload that image and use the provided url. Such as https://imgur.com/. After upload it, use into the src the correct url with the filetype extension.

  •  Tags:  
  • Related