I have a problem with jquery in nodejs (jsdom):
[server]
const http = require('http');
const fs = require('fs');
const $ = require('jquery');
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const main = require('./main');
const dom = new JSDOM(`<!DOCTYPE html><html><body><p>Hello world</p></body>`);
http.createServer(function(request, response){
response.writeHeader(200, {"Content-Type": "text/html"});
response.write(dom.serialize());
response.end();
}).listen(8080);
and
[main]
$.get('xxx').then(function(xxx) {
...
Error:
$ is not defined
I want to have access to the house through jquery Where is the mistake?