+ Start a Discussion
Jon ManloveJon Manlove 

Can't complete the 'Use Static Resources' challenge even though code produces correct page

I have completed the challenge for the 'Use Static Resources' module and the preview shows the 'cat' image but the 'Check Challenge' function gives me the following message in a red box - "Challenge Not yet complete... here's what's wrong: 
The page does not include a reference to the specified image. HINT: The static resource does not require a '/' in the image URL. If you are using this, try removing and check again."

I've included the code I used to complete the challenge and it does include a reference to the specified image, otherwise how could it display.  Please advise.  Thanks.

<apex:page showHeader="false" sidebar="false" standardStylesheets="false">
    
        <!-- Display images directly referenced in a static resource -->
        <h3>Images</h3>
   
    <apex:image url="{!URLFOR($Resource.vfimagetest, '/cats/kitten1.jpg')}"/>          

</apex:page>
Best Answer chosen by Jon Manlove
Alain CabonAlain Cabon
Hi,

<apex:image value="{!URLfor($Resource.vfimagetest, 'cats/kitten1.jpg')}"/>.

Problem is the first '/' perhaps again.

https://developer.salesforce.com/forums/?id=906F0000000B2DIIA0
 

All Answers

Alain CabonAlain Cabon
Hi,

<apex:image value="{!URLfor($Resource.vfimagetest, 'cats/kitten1.jpg')}"/>.

Problem is the first '/' perhaps again.

https://developer.salesforce.com/forums/?id=906F0000000B2DIIA0
 
This was selected as the best answer
Jon ManloveJon Manlove
Great!  Thanks Alain, that was the answer.