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

171
Views
la página del servidor en vivo se carga infinitamente

Soy un principiante en la codificación y más específicamente en JavaScript y HTML, y en este momento solo estoy tratando de dibujar un cuadrado y hacer que se cargue. Sin embargo, cuando trato de crear mi servidor, simplemente carga la página para siempre, por lo que no puedo probar mi código. ¿Hay alguna manera de que pueda hacer que mi página realmente se cargue? Aquí está mi código hasta ahora:

html:

 <html> <canvas id = 'canvas' height = '500' width = '500'></canvas> <script src = 'sus.js'></script> </html>

JavaScript:

 const canvas = document.getElementById('canvas') const ctx = canvas.getContext('2d') ctx.beginPath() ctx.strokeRect(0, 0, 500, 500) let x = 50 while(true){ ctx.beginPath() ctx.fillRect(x, 50, 50, 50) x++ }

¡Gracias!

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

0

Comente y también responderé.

while(true) significa - ejecutar infinitamente, porque no hay un punto de parada para el bucle.

Intente configurar el ciclo while para que se ejecute hasta que x sea mayor a 200.

 while(x <= 200){ ctx.beginPath() ctx.fillRect(x, 50, 50, 50) x++ }
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!