Activity Forums Salesforce® Discussions Uncaught ReferenceError: jQuery is not defined throws at /resource/select_3/select2.min.js:4:188

  • Uncaught ReferenceError: jQuery is not defined throws at /resource/select_3/select2.min.js:4:188

    Posted by Arun on August 25, 2016 at 12:01 pm

    Hi,

    I am using this plugin "https://select2.github.io/" and uploaded the zip in static resource.

    Now I am using the below code in the component:

    <ltng:require scripts="/resource/select_3/select2.min.js" />

     

    I am getting the "Uncaught ReferenceError: jQuery is not defined
    throws at /resource/select_3/select2.min.js:4:188" error.

     

    Arun replied 8 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Piyush

    Member
    August 26, 2016 at 11:25 am

    Hi Arun,

    I am also getting the same error message  “Uncaught ReferenceError: jQuery is not defined
    throws at /resource/select_3/select2-4.0.3/dist/js/select2.min.js:3:118”.

    But when I was added  "jquery-2.2.3.min.js"  this issue was resolved.

    You should try like this :-

    <ltng:require scripts="/resource/LatestJQuery/LatestJQuery/jquery-2.2.3.min.js" />
    <ltng:require scripts="/resource/select_3/select2-4.0.3/dist/js/select2.min.js" />

    Thanks

  • Piyush

    Member
    August 26, 2016 at 12:39 pm

    Hi Arun,

    You have to add one more JQuery file named "jquery-2.2.3.min.js" before the "select2.min.js" script. When the "select2.min.js" file load it can not find the main jquery file that's why it was failed.

    Regards
    Piyush Kumar

  • Arun

    Member
    August 29, 2016 at 9:09 am

    Thank you Piyush,I have added that jquery file earlier but on tht time new "Expando" error was throewing. Now I have  changed jquery version and working fine.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos