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
Heaven DevHeaven Dev 

Cannot read property 'expando' of undefined throws

I have create  lightning components.
In this I have add Jquery but it given Error:
" Cannot read property 'expando' of undefined throws"
I have added single JS File.
<ltng:require scripts="{!$Resource.JqueryJS}" afterScriptsLoaded="{!c.doInit}" />

Please Help me?


 
Best Answer chosen by Heaven Dev
Pritesh MaturkarPritesh Maturkar

Hello Heaven Dev,

I have gettting same issue and I have read following link 

http://sfdcmonkey.com/2018/03/13/jquery-datatable-salesforce-lightning-component/

and it solved.

it Recommended  Jquery  version 2.2.4.


 

scriptsLoaded : function(component, event){
       $(document).ready(function(){            
            alert('Hello');                     
        });      
    },
 
<ltng:require styles="{! $Resource.	datatable + '/DataTables-1.10.16/media/css/jquery.dataTables.min.css'}" 
                  scripts="{!join(',', 
                           $Resource.jquery224 , 
                           $Resource.datatable + '/DataTables-1.10.16/media/js/jquery.dataTables.min.js')
                           }" afterScriptsLoaded="{!c.scriptsLoaded}"/>

Please try this.