Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda