Sweetalert: nicht abgefangene Ausnahme: abbrechen

Erstellt am 1. Dez. 2016  ·  5Kommentare  ·  Quelle: t4t5/sweetalert

Dieser Fehler wird angezeigt, wenn ich in Sweetalert2 auf die Schaltfläche "Abbrechen" klicke

swal({ title: menu_title, text: title, input: "text", showCancelButton: true, animation: "slide-from-top", showLoaderOnConfirm: true, inputPlaceholder: lang.write_your_comment, preConfirm: function(inputValue) { return new Promise(function(resolve, reject) { resolve('ok'); }); }) }, allowOutsideClick: false }).then(function(result){ var res = $.parseJSON(result); if(res.status){ swal({ title: lang.thankyou+"!", text: lang.your_feedback_sent, type: "success" }).then(function(confirm){ location.reload(); }); } else{ swal({ title: lang.sorry+"!", text: res.message, type: "warning" }); } });

Hilfreichster Kommentar

Falls jemand hierher kommt und steckenbleibt (weil sweetalert != sweetalert2 !)

Fügen Sie am Ende von swal({...}) Folgendes hinzu: .catch(() => swal.close())

Jede Promise-Funktion benötigt einen Fehler-Callback.

Alle 5 Kommentare

Wenn Sie auf das Schließen-Symbol klicken, wird auch ein Fehler angezeigt.
unabgefangene Ausnahme: schließen

Sollte hier gepostet werden: https://limonte.github.io/sweetalert2/

Falls jemand hierher kommt und steckenbleibt (weil sweetalert != sweetalert2 !)

Fügen Sie am Ende von swal({...}) Folgendes hinzu: .catch(() => swal.close())

Jede Promise-Funktion benötigt einen Fehler-Callback.

@eminx du hast meinen Tag gerettet :)

@eminx ich auch!!

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen

Verwandte Themen

adiwithadidas picture adiwithadidas  ·  4Kommentare

xgqfrms-GitHub picture xgqfrms-GitHub  ·  4Kommentare

rapeflower picture rapeflower  ·  4Kommentare

daftspunk picture daftspunk  ·  4Kommentare

blackrosezy picture blackrosezy  ·  6Kommentare