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

366
Views
¿Cómo puedo usar jQuery en un archivo JS? (hazaña. Frasco)

app.py

 from flask import Flask, render_template, request, jsonify app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') if __name__ == '__main__': app.run('0.0.0.0', port=5000, debug=True)

índice.html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="static/index.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="scripts/jquery-1.10.2.js"></script> <script src="/jquery/index.js"></script> <title>Title</title> <script> </script> </head> <body> <h1>Hello World!</h1> </body> </html>

índice.js

 $(function () { $(document).ready(function () { alert('Hello World'); }); }

Creo que estoy haciendo algo mal. Quiero mostrar un mensaje cuando el documento esté listo. Incluso si ejecuto app.py, la alerta no aparece.

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Has intentado incrustar el script directamente dentro del código html?

 ... <script>your script code</script> </body> </html>

Si eso funciona, la ruta relativa a src="/jquery/index.js" podría no ser correcta.

¿Revisó los archivos de registro de Apache (o cualquier servidor web que ejecute) en errores relacionados con index.js?

about 4 years ago · Juan Pablo Isaza 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!