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
Ayan SarkarAyan Sarkar 

Calling a static resource resource javascript functoin from lightning component

I have a static resource named as 'geoCode' it has a function as below function callMe(){ alert('You are inside static resource'); }

I want to call this function from lightning component controller and expecting an alert message on screen.

What is the way out? please help me fast..
sandeep@Salesforcesandeep@Salesforce
Hi Ayan,
To reference a JavaScript library that you’ve uploaded as a static resource, use a <ltng:require> tag in your .cmp or .appmarkup.
<ltng:require scripts="/resource/resourceName" afterScriptsLoaded="{!c.afterScriptsLoaded}" />

Thanks
Sandeep Singhal
http://www.codespokes.com/
Ayan SarkarAyan Sarkar

HI Sandeep.

thats what I did. I called the function from the controller function 
afterScriptsLoaded.. But an internal error is flashed saying that no such function as 'callMe()' has been declared.