when i try to create an item which is to be saved on the local Storage first and then display on the screen, the inputs display on the screen except the image.
- April 26, 2023
- 235 views
- 0 votes
- 2 Answers
-
when i try to create an item which is to be saved on the local Storage first and then display on the screen, the inputs display on the screen except the image.
2
Answers
If the path to your image isn’t correct, you will see the path printed to the screen instead of an image. Double check that your path is correct and it should display.
If you’re not sure, you can use FileReader to check if your path exists – https://developer.mozilla.org/en-US/docs/Web/API/FileReader.
You didn’t specified if you were using a Framework or not.
If you’re using a Framework, every images, stylesheets, fonts, etc. need to be put in a public file in the root directory of the project. Otherwise, it wont display