Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

289
Vistas
El texto del botón no se muestra en SweetAlert

ingrese la descripción de la imagen aquí

Realmente no sé qué estoy haciendo mal aquí. SweetAlert funciona bien, pero no muestra el texto del botón.

 swal({ title: "Are you sure?", text: "Once deleted, you will not be able to recover this imaginary file!", icon: "warning", buttons: true, dangerMode: true, });
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Intenta crear una página html limpia y pruébalo así:

 swal({ title: "Are you sure?", text: "Once deleted, you will not be able to recover this imaginary file!", icon: "warning", buttons: true, dangerMode: true, })
 <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

Probablemente el problema sea con otras secuencias de comandos en su página, ya que su código debería funcionar, en su lugar, puede intentar usar Sweetalert2 de esta manera:

 Swal.fire({ title: 'Do you want to save the changes?', showCancelButton: true, confirmButtonText: 'CONFIRM', denyButtonText: `CANCEL`, }).then((result) => { /* Read more about isConfirmed, isDenied below */ if (result.isConfirmed) { // confirm button pressed console.log("confirm") } else if (result.isDismissed) { // deny button pressed console.log("deny") } })
 <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.1.9/dist/sweetalert2.all.min.js"></script>

EDITAR:

Intente agregar jquery en su página HTML antes de importar otras secuencias de comandos como esta:

 <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
about 4 years ago · Juan Pablo Isaza Denunciar

0

aquí está la respuesta

 swal({ title: "Are you sure?", text: "Once deleted, you will not be able to recover this imaginary file!", type: "warning", showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: 'Yes', cancelButtonText: "No", closeOnConfirm: false, closeOnCancel: false },

O

 swal({ text: "Once deleted, you will not be able to recover this imaginary file!", buttons: ["Yes", "No"], });

o

 <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> swal("Are you sure you want to do this?", { buttons: ["Yes", "No"], });
about 4 years 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 vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda