https://netsuiteprofessionals.com logo
#general
Title
# general
n

NSObsessed

03/12/2018, 3:24 PM
Can anyone help me plug JQUERY to SS2.0 . Based on the NetSuite documentation I have created a JSON file that has this code which points to my Jquery file path in the file cabinet...
Copy code
{
  "paths": {
    "jquery": "SuiteScripts/SuiteScript 2.0/JS_Libraries/jquery-3.3.1.js"
  }
}
Now on a SS2.0 user event, I include the AMD tag like this:
Copy code
/**
@NApiVersion 2.0
@NScriptType usereventscript
@NAmdConfig  ./JsLibraryConfig.json 
@ModuleScope Public
*/
define(["N/search", "../SuiteScript 2.0/JS_Libraries/moment.js", "jquery"], function (se, m, jquery){
But this keeps failing with an error like this:
Copy code
{
  "type": "error.SuiteScriptModuleLoaderError",
  "name": "TypeError",
  "message": "Cannot call method \"createElement\" of undefined",
  "stack": "\tat /SuiteScripts/SuiteScript 2.0/JS_Libraries/jquery-3.3.1.js:882 (assert)\n\tat /SuiteScripts/SuiteScript 2.0/JS_Libraries/jquery-3.3.1.js:2701\n\tat /SuiteScripts/SuiteScript 2.0/JS_Libraries/jquery-3.3.1.js:499\n\tat /SuiteScripts/SuiteScript 2.0/JS_Libraries/jquery-3.3.1.js:36\n\tat /SuiteScripts/SuiteScript 2.0/JS_Libraries/jquery-3.3.1.js:14\n\tat INVOCATION_WRAPPER$sys:19\n\tat INVOCATION_WRAPPER$sys:31\n\tat INVOCATION_WRAPPER$sys:1\n"
}
Does anyone know what I may be doing wrong?