Activity Forums Salesforce® Discussions Can we include external JavaScript/CSS libraries in Salesforce Components?

  • shariq

    Member
    September 23, 2018 at 11:00 pm

    It is possible to use custom CSS and JAvascriipt in the Lightning component

  • Parul

    Member
    September 24, 2018 at 12:16 am

    <ltng:require styles="/resource/firstcss[,/resource/secondcss]"
    scripts='/resource/javascript1.js,[/resource/javascript2.js]' afterScriptsLoaded="
    {!c.firstLoadFunction}" />

    Explanation of above example:
    1. style – access multiple CSS files with comma separated. Load files from left to right.
    2. script – access multiple javascript files with comma separated. Load files from left to right.
    3. afterScriptsLoaded – to provide javascript function to notify when all javascript files are loaded.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos