Estoy trabajando en un proyecto QR donde, al escanear, se navega al usuario a una página web donde se pasan sus parámetros de ubicación. Luego consultará una tabla html para el número de teléfono de la línea de crisis apropiado e iniciará el teclado de marcación del teléfono usando javascript: window.open('tel:5555555555'). Esta función funciona en la consola del navegador sin problemas, pero por alguna razón no funciona cuando se publica la página web. Consulta con éxito la tabla, devuelve la ubicación correcta y el número de teléfono que registro, pero no abre el teclado del teléfono en absoluto. Esa es la única parte que falta. ¿Alguien sabe por qué puede ser esto?
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"; } } } }}