4

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?

2 Answers 2

6

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

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

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_resources_reference.htm

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

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.