You need to sign in to do that
Don't have an account?
amarendra nagireddy
how to use $Resource global variable....
hep me out to how to use $resource globla variable......in so many examples i seen like
{!$Resource.example_js} ,i am not getting one thing here...from where i am including this javasctipt file....am i need to upload this file into my documents by using document tab...otherwise where can i upload this document to refer in my visualforce page.
{!$Resource.example_js} ,i am not getting one thing here...from where i am including this javasctipt file....am i need to upload this file into my documents by using document tab...otherwise where can i upload this document to refer in my visualforce page.
This sysntax of code you get is to access static resource an duse in VF page .
Check belwo link how to create static resource in SFDC .
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_resources_create.htm
Next how to use static resource in VF page .Below link will help you
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_resources_reference.htm
Basically "{!$Resource.TestImage}" is for single resource ,Here TestImage is the resource name .
Example two ."{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" ,Here TestZip is teh zip file name and Bluehills is teh fiel name .
Let me know if it helps .
Thanks
Manoj
To reference a stand-alone file(testCSS), use $Resource.<resource_name> as a merge field, where <resource_name> is the name you specified when you uploaded the resource. For example, if you have uploaded the css file with the name "testCSS", then you can refer it like this:
You do not need to make a zip file for a single resource(testCSS).Suppose you're building a Visualforce Page where you need to use CSS(MyCss), Javascript(MyJS) and multiple images(img1, img2, etc.), then you can archive these resources into "MyVFProject" zip folder. Then upload the MyVFProject zip folder as a static resource named “MyVFProject_Resources” and refer it like this:
For more details:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_resources_reference.htm