jjzjj

SweetAlert

全部标签

javascript - SweetAlert 通过 Ajax 请求确认

我是Javascript的新手-第一次实际编码。我正在尝试用SweetAlert做一个带有删除确认的按钮.当我用onclick="confirmDelete()"按下按钮时没有任何反应。这段代码可能只是螃蟹,但它在这里:functionconfirmDelete(){swal({title:"Areyousure?",text:"Youwillnotbeabletorecoverthisimaginaryfile!",type:"warning",showCancelButton:true,confirmButtonColor:"#DD6B55",confirmButtonText:"

javascript - 将 Sweet Alert 弹出窗口添加到 React 组件中的按钮

我找到了这个完美的用于Bootstrap和React的SweetAlert模块(我正在我的Meteor应用程序中使用):http://djorg83.github.io/react-bootstrap-sweetalert/但我不明白您如何将此代码包含在React组件中。当有人在我的应用程序中单击“删除”按钮时,我希望弹出SweetAlert提示以请求确认。这是删除按钮的组件:importReact,{Component}from'react';importGoalsfrom'/imports/collections/goals/goals.js'importSweetAlertfro

javascript - 在 sweetAlert 中输入文本

我正在使用sweetalert的自定义版本向我的用户询问input。我已经设法使一切正常,但有一个奇怪的行为,为了能够在输入框中输入文本,您必须先点击屏幕:swal({title:"Aggiornamentoprofilo",text:'',type:"warning",showCancelButton:false,confirmButtonText:"Aggiornailmioprofilo",closeOnConfirm:false},function(){swal("Deleted!","Yourimaginaryfilehasbeendeleted.","success");}

javascript - 未捕获的类型错误 : Cannot read property 'then' of undefined using Sweet Alert

我正在使用SweetAlert2我收到以下错误UncaughtTypeError:Cannotreadproperty'then'ofundefined当我使用与SweetAlert页面中建议的完全相同的代码时。swal({title:'Areyousure?',text:"Youwon'tbeabletorevertthis!",type:'warning',showCancelButton:true,confirmButtonColor:'#3085d6',cancelButtonColor:'#d33',confirmButtonText:'Yes,deleteit!',canc

javascript - 页面未等待来自 SweetAlert 确认窗口的响应

我正在尝试升级我的JavaScriptconfirm()操作以使用SweetAlert.目前我的代码是这样的:Delete这会等待用户在导航到删除页面之前进行确认。我想使用SweetAlert中的这个示例在删除之前要求用户确认:swal({title:"Areyousure?",text:"Youwillnotbeabletorecoverthisimaginaryfile!",type:"warning",showCancelButton:true,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes,deleteit!",cance

javascript - 如何在ajax请求完成时关闭甜蜜警报

我在我的Angular应用程序中使用Sweet-alert。functionGetDataFromServer(url){SweetAlert.swal({title:"",text:"Pleasewait.",imageUrl:"../../app/app-img/loading_spinner.gif",showConfirmButton:false});return$http.get(url).then(success).catch(exception);functionsuccess(response){//SweetAlert.swal(//{//title:"",//tex

javascript - 未捕获的 SweetAlert : Unexpected 2nd argument?

我有sweetalert的问题,我想在按钮点击时显示确认框警报,但它不起作用这是我的JS代码:$(document).ready(function(){$('[data-confirm]').on('click',function(e){e.preventDefault();//canceldefaultaction//Recuperatehrefvaluevarhref=$(this).attr('href');varmessage=$(this).data('confirm');//popupswal({title:"Areyousure??",text:message,type:

javascript - SweetAlert - 改变按钮的颜色

我正在尝试像更改确认按钮一样更改取消按钮的颜色,但由于某种原因它似乎不起作用。swal({title:"Areyousure?",text:"Youwillnotbeabletorecoverthisimaginaryfile!",type:"warning",showCancelButton:true,cancelButtonColor:"#DD6B55",confirmButtonColor:"#DD6B55",confirmButtonText:"Yes,deleteit!",cancelButtonText:"No,cancelplease!",closeOnConfirm:f

javascript - sweet alert 确认后继续提交表单

我在提交表单时触发了这个sweetalert。$(".swa-confirm").on("submit",function(e){e.preventDefault();swal({title:$(this).data("swa-title"),text:$(this).data("swa-text"),type:"warning",showCancelButton:true,confirmButtonColor:"#cc3f44",confirmButtonText:$(this).data("swa-btn-txt"),closeOnConfirm:false,html:false}

javascript - sweetalert 2 上有超过 2 个按钮

我有一个带2个按钮的sweetalert,但我想在其中多一个按钮。例如,截至目前,我有"is"和“否”,我想再添加一个按钮,请稍后再说。请帮忙。$("#close_account").on("click",function(e){e.preventDefault();swal({title:"Areyousure?",text:"Youwillnotbeabletoopenyouraccount!",type:"warning",showCancelButton:true,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes,close