Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

77
Vistas
From Array to individual string in Jquery?

there is a problem with my code I try to split array values to single individual strings that contains part of links.

I tried with dele.join() , but still the output is single string with coma separation

$(function () {

            $("#selectedel").click(function () {
                var dele =[]; // Array look like this  ["/delete.php?id=1","/delete.php?id=2","/delete.php?id=3"]
                $.each($("input:checkbox[name='dele']:checked"), function () {
                    dele.push($(this).val());

                });
                console.log(dele.toString());
                console.log(dele.join(","));
            })


        });

output of this code is

/delete.php?id=1,/delete.php?id=2,/delete.php?id=3

The output that i want is

/delete.php?id=1
/delete.php?id=2
/delete.php?id=3

Which in the end i want to open this links with window.open() at once .

Thank you in advance

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try this one

["/delete.php?id=1", "/delete.php?id=2", "/delete.php?id=3"].map((url) => {
  const xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function() {};
  xhr.open('GET', url);
  xhr.send();
});
7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.