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

118
Visualizações
Launch phone dialpad in webpage with Javascript

I'm working on a QR project where upon scan, the user is navigated to a webpage where their location parameters are passed. It will then query an html table for the appropriate crisis line phone number and launch the phone dialpad using javascript: window.open('tel:5555555555'). This function works in the browser console with no issues, but for some reason it is not working when the web page is published. It successfully queries the table, returns the correct location and phone number which I log, but it doesn't open the phone dialpad at all. That's the only part that's missing. Does anyone know why this might be?

    LaunchCrisisLine();

function LaunchCrisisLine() {
  //get URL - location params
  const queryString = window.location.search;
  const urlParams = new URLSearchParams(queryString);
  const location = urlParams.get('location');
  console.log(location); 
  
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = location; 
  if(input != null){
  filter = input.toUpperCase();
  table = document.getElementById("crisisLineTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    td2 = tr[i].getElementsByTagName("td")[2];
    if (td) {
      txtValue = td.textContent || td.innerText;
      crisisLine = td2.getElementsByTagName('a')[0].href;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
        window.open(crisisLine); 
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

}

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