You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Importing external JS file in shell.js

edited Apr 1, 2019 12:18PM in Visual Builder 9 comments

Summary

Importing external JS file in shell.js

Content

Hi,
I tried to import and execute a custom JS file in shell.js using ajax call..
 $.getScript("../templateappn/resources/js/lib/jquery.main.js")
      .done(function(script, textStatus) {
        console.log(textStatus + "*********");
      })
      .fail(function(jqxhr, settings, exception) {
        $("div.log").text("Triggered ajaxError handler.");
      });
My Custom JS File is getting loaded and success msg is also getting printed in console.. but when it tries to read and execute the jquery functions present in custom js file.. it throws an error - "ReferenceError: $ is not defined" in the first line..

Not sure where to define the jquery symbol.. 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!