Here is the code, I wanted to create js code to request a web service where there is form data and printing these data in console I run this code with Node.js:
//importing jQuery
var $ = require('jQuery');
//defining the parameters of HTTP request
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.kizeoforms.com/rest/v3/forms/",
"method": "GET",
"headers": {
"content-type": "application/json",
"Authorization": "perma_restv3_MTH_024b61f4bf72fd4c46d7633be7e21e083d8b660f",
"cache-control": "no-cache",
}
}
//sending request and printing of response in console
$.ajax(settings).done(function (response) {
console.log(response);
});
Here is what the console send me :
$.ajax(settings).done(function (response) {
^
TypeError: $.ajax is not a function
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
[Finished in 0.1s]
I have already installed jQuery now I'm pretty much stuck with this problem,
Thank you,