How could I access the image which is inside the .zip and inside the folder in which name the spaces are present in lightning?
For example, I have no problems accessing the following static resource:
$Resource.tF + '/f1/f2/testImg.png'
But I really can not access
$Resource.tF + '/f1/f 2/testImg.png'
Even when I try:
$Resource.tF + '/f1/f_2/testImg.png'
I was able to find nothing about the naming conventions in the case the only solution seems to be is to name the folders inside the .zip
without any spaces.
<img src="{!$Resource.SLDSv2 + '/assets/images/avatar1.jpg'}"/>
. You said you'd want it in Javascript, and it'll give you access to the URL of the image and not the image itself. Perhaps, put it in an <img> tag and access that from javascript to get hold of it and you can then add relevant styling?