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

151
Views
HTML no carga archivos JS

Intento hacer un sitio web simple con archivos js y css externos.

HTML:

 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script src="../js/main.js"></script> <title> John Doe </title> </head> <body> <div> <p>Landing Page in Progress</p> <button onclick="clickAlert()">Test</button> </div> </body> </html>

JS:

 function clickAlert() { alert("Test") }

Estructura de carpetas:

estructura_carpetas

Pero cuando hago clic en el botón, aparece el error "clickAlert no está definido" . Todo está alojado en un servidor web que ejecuta Ubuntu/Apache. Sé que para esta función simple no necesitaría un archivo externo, pero quiero expandir más el sitio. ¡Gracias por cada ayuda!

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Debe colocar la carpeta js en la carpeta estática y luego colocar el src como "js/main.js". Si el javascript no está incluido en la carpeta estática, el servidor no sabe cómo colocar esos archivos en el servidor.

about 4 years ago · Santiago Trujillo Report
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!