I have a zipped static resource uploaded in my salesforce org which contains different types of js . I want them to be referred in my script on visualforce page. How can I do this?


You have to include it as you would with any other JS file.

<apex:includeScript value="{!URLFOR($Resource.LibraryJS, '/base/subdir/file.js')}"/>


  • Thanks Sander for the reply , but this script is to be reffred somewhere in the my script which I have written on my page May 3 '16 at 12:43
  • Yes, if you include it like this you will be able to refer it from your page.
    – feddus
    May 3 '16 at 13:53

If you want to use a static resource in the javascript then use :-

"nope: ['{!$Resource.abc}', '{!$Resource.xyz}']"

where "nope:" is a statement in my javscript.

Or else you can use just "'{!$Resource.abc}'" where ever you want to include your static resource javscript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.