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 ?

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

|improve this answer|||||

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.