function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kachmar SofiyaKachmar Sofiya 

LWC loadScript - is there a way to set attributes before script load?

In order to load an external script into LWC loadScript should be used: https://developer.salesforce.com/docs/component-library/bundle/lightning-platform-resource-loader/documentation

Iøm facing the problem as I need to set data attributes on the script tag for the script to be loaded correctly. Any suggestions?
VinayVinay (Salesforce Developers) 
Hi Kachmar,

Check below references.

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.js_third_party_library
https://www.salesforcecodecrack.com/2019/03/how-to-import-third-party-libraries-in.html

Thanks,
Bhagyashri Jadhav 78Bhagyashri Jadhav 78
@kachmar Sofiya, did you find any solution for above issue? I am facing same issue in my project.
Bhagyashri Jadhav 78Bhagyashri Jadhav 78
@kachmar Sofiya, did you find any solution for above issue? I am facing same issue in my project.
Hitesh chaudhariHitesh chaudhari
Using ConnectedCallBack and renderCallBack methods you can set values of the Track variable before page onload
  • connectedCallBack function invokes/fires automatically when certain lwc components are inserted into web dom. executes only one time.
  • RenderCallBack executes every time when Component render