场景如下:
我有一堆<a href="X">元素,所以在重定向发生之前,我想等待一个引导模式/ jqueryui对话框(从未挖掘过,尽管我更喜欢使用引导模式)被确认或取消。我尝试过一种
$('a').on('click',function(){
alert('!'); //this one of course happens before the redirect
$( "#dialog-confirm" ).dialog({...}); //this one shows and is immediately redirected
});我怎样才能满足我的需求呢?
发布于 2019-12-29 04:34:18
我是通过以下方式做到的:
$('.modal_before_click').on('click',function(e){
redirect_after_modal = $(this)[0]['href'];
$('#modal_cancel_button').on('click',function(){window.location = redirect_after_modal; });
$('#modal_trigger_button').trigger('click');
return false;
});https://stackoverflow.com/questions/59514425
复制相似问题