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

198
Views
¿Cómo pongo en negrita un elemento de celda de una fila de tabla durante n segundos?

Tengo un fragmento de código en el que llamo a mi servidor para obtener algunos valores y actualizar la tabla si ese valor no está presente allí. Después de la actualización, quiero que se notifique al usuario la fila donde se actualizó el valor, haciendo que el valor de la celda esté en negrita durante n segundos.

 var table=document.getElementById("employee_details"); var jsonString = JSON.stringify(array); $.ajax({ url: '/server.php', type: 'POST', data: {"input":"calculate_charges", data:jsonString}, cache: false, success:function(response){ const arr3=JSON.parse(response); for(var i=0; i<arr3.length; i++){ if(table.rows[i+1].cells.item(10).innerHTML!=arr3[i][2]){ table.rows[i+1].scrollIntoView({ behavior: 'smooth', block: 'center' }); table.rows[i+1].cells.item(10).innerHTML=arr3[i][2]; setTimeout(function(){ table.rows[i+1].cells.item(10).style.fontWeight = "500"; },7000); setTimeout(function(){ table.rows[i+1].cells.item(10).style.fontWeight = "900"; },4000); } } } complete:function(){} });

Al ejecutar el código, sigo recibiendo este error en la consola:

TypeError no capturado: no se pueden leer las propiedades de undefined (leyendo 'celdas')

Y el elemento de la celda no se pone en negrita. ¿Cómo soluciono este problema?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use dejar entrar para bucle:

 for(let i=0; i<arr3.length; i++){

Acerca de dejar: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let

over 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!