How can I link to an image in Meteor?

I am showing the html table in a very basic meteor application - I just replaced the meteor html template with my html table, and it looks great. But I need to add an image after the table, and I tried this:

. . . </TABLE> <img border="0" height="640" hspace="0" src="RegConvFAPSSMapWithNumbers.png" width="800" /> </body> 

But wherever I hoped it would be an image, I just see the outline of its size and the “busted image” icon.

First, I placed the image in the main directory of the project (at the same level as <projectName> .css, <projectName> .html (the file I'm trying to add the image to), and <projectName>; .. js)

Then I created the folder "public \ images" and copied the image there, but that doesn't make any difference.

I am incorrectly referring to the image, can I not find it elsewhere or what?

+5
source share
2 answers

If you want to reference assets (images, favicon.ico, robots.txt, etc.), you must create a top-level folder public in your Meteor project.

Since you added your image to public/images , I assume you should point to /images/my_image.png . This below should do the trick:

 <img border="0" height="640" hspace="0" src="/images/RegConvFAPSSMapWithNumbers.png" width="800" /> 
+13
source

I recently had a similar problem. Just put / in front of the image path

 src="/RegConvFAPSSMapWithNumbers.png" 
+4
source

All Articles