I want to load in two static resource js files. My code:

<ltng:require scripts="{!join(',' $Resource.resource1, $Resource.resource2)}"/>

On save attempt, I get the following error:

expecting a right parenthesis, found '$Resource' at column 10 of expression: join(',' $Resource.resource1, $Resource.resource2):

I tried sticking the two resources into two different ltng:require, which means I can save the page:

<ltng:require scripts="{! $Resource.fileStack }"/>
<ltng:require scripts="{! $Resource.filestackConnector }"/>

but then I get error:

Custom Script Eval error in "ltng:require" [SecureDOMEvent: [object Event](key: {"namespace":"c"}}]


you missed comma after ','. It should be

<ltng:require scripts="{!join(',', $Resource.resource1, $Resource.resource2)}"/>

Check Expression Functions Reference.

Joins the substrings adding the separator String (first argument) between each subsequent argument.

It has arguments, first is separator and all arguments should be separated by a comma.

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.