Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

157
Visualizações
What revision of the Browser/Javascript specification is causing a change in selected table cell

In 2016 I wrote a Javascript function for a web application (flyatlas2.org) that does the following:

If you click in a cell in Table 1, it highlights the appropriate column in Table 2.

This is illustrated by the the left screenshot below, which is an example the user can view and check here.

Screen shot of different table highlighting

It was taken under Mac OS X Mojave with the Safari (v.14.1.2) web browser, although Chrome (103) behaves the same way, as does Edge on Windows 10 (Education 21H2 64 bit running in emulation).

However, under Mac OS X Mojave with Firefox (v.101), all these browsers on Mac OS X Monterey, and Chrome (v.103) or Firefox on Windows 10 , the column highlighted in the lower table is that headed Ag (Accessory glands), not Cs (Carcass), as shown on the right. (I was alerted to the problem by someone running Windows on a PC rather than in emulation on a Mac.)

So something must have changed in the browser interpretation of Javascript. But what?

My code is below (the top table is geneTable, the bottom one transTable):

function hiliteTrans(geneCellID, geneTableID)
{  
    clearBordersT();  // removes borders from any previous selection
    // IDs follow underscore
    var transTableID = "tabTrans" + geneTableID.substring(geneTableID.indexOf("_"));
    geneCellID = geneCellID.substring(geneCellID.indexOf("_") + 1);
    var transTable = document.getElementById(transTableID); 
    for (var i=1; i<transTable.rows.length; i++) // modified for two name rows
    {
        for (var j=2; j < transTable.rows[i].cells.length; j++)
        {
            if(j-1==geneCellID) // modified for two name cells
            {
                if(i==1)
                {
                    transTable.rows[i].cells[j].classList.add("highlightT");
                }
                else
                {
                    transTable.rows[i].cells[j].classList.add("outlineT");
                }
            }
        }
    }  
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda