0

I am trying to add jquery-steps javascript library in my lightning component. But obviously it is not loaded.

This is the code I've used:

    <ltng:require styles="/resource/jquerystepcss" scripts='/resource/jquery,
/resource/jquerystepjs' afterScriptsLoaded="{!c.doInit}" />

The jquery and the css files are loaded but not the query-steps one. Could you please advise how to debug this. Is it caused by the locker Service ?

3

1 Answer 1

2

I consider jquerystepcss and jquerystepjs are the files in static resources. You should use the id(click on view file in static resource and get the id) e.g https://*****c.ap1.visual.force.com/resource/1500638472000/dtcss

so finally your code should look like <ltng:require styles="/resource/1500638472000/jquerystepcss" scripts='/resource/1500638472000/jquery, /resource/1500638472000/jquerystepjs' afterScriptsLoaded="{!c.doInit}" />

But these id's will get change when you move static resources and other stuff to production org so you should use below code

<ltng:require scripts="{!join(',', 
                        $Resource.jquery, 
                        $Resource.jquerystepjs)}"
              styles="{!$Resource.jquerystepcss}" afterScriptsLoaded="{!c.load}"/>

Get the details here

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.