• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

91
Vistas
NodeJS include require(jquery) etc in .js file without interfering with standard javascript->html interactions

Working on a project for my internship, after a basic proof of concept I am now trying to get a nodeJS program that can call in functions from a .js file linked to a company intranet website and execute them.

I'm running into an issue with having nodeJS read the .js file/call in the proper functions while also ensuring that the front end/html still runs as intended. The .js file includes lines of jquery which nodeJS requires the use of something like

var $ = require('jquery');

in order for it to run. However, if I include this line (or, after some checking, ANY require('') statement, even if the variable assigned to the require is unused) in the .js, it causes some sort of break in the normal operations so that the front-end html site no longer displays/queries data properly.

Unfortunately I don't have a minimum code example to show so mainly looking to spitball ideas from anyone on if they've had similar problems. Possible solution would be to have a separate .js file with all the same functionality but re-written/adjusted to work for nodeJS, but we want to avoid that if possible

9 months 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 empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.