Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Unable to use jquery with nodejs

Being a beginner i've tried different ways to include jquery functions in my node file. I've installed jquery and jsdom and added,

const { JSDOM } = require( "jsdom" );
const { window } = new JSDOM( "" );
const $ = require( "jquery" )( window );

to my app.js file.

My file Structure is as follows,

ProjectName
├───views
│    file1.ejs
|    file2.ejs
|     ...
|     file6.ejs
├───public
│   ├───css
│   │    file1.css
|   |    ...
│   └───img
|        ...
├───app.js

Now when i run any jsquery commands, for eg. $("div).text(); nothing happens. I believe this is because jquery has not been added properly. I've tried adding script tags to html but that doesnt seem to change anything, so if anyone could help me to understand what im missing or if im missing anything what i should add, for eg. if im missing a script tag. Where should i add it and how?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!