Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
单击a href之前显示的jquery ui/引导对话框_Jquery_Redirect_Twitter Bootstrap 3_Modal Dialog - Fatal编程技术网

单击a href之前显示的jquery ui/引导对话框

单击a href之前显示的jquery ui/引导对话框,jquery,redirect,twitter-bootstrap-3,modal-dialog,Jquery,Redirect,Twitter Bootstrap 3,Modal Dialog,情况如下: 我有大量的元素,因此在重定向发生之前,我想等待引导模式/jqueryui对话框(尽管我更愿意使用引导模式,但这是不确定的)被确认或取消。 我试过一种 $('a').on('click',function(){ alert('!'); //this one of course happens before the redirect $( "#dialog-confirm" ).dialog({...}); //this one shows and is immediatel

情况如下:

我有大量的
元素,因此在重定向发生之前,我想等待引导模式/jqueryui对话框(尽管我更愿意使用引导模式,但这是不确定的)被确认或取消。 我试过一种

$('a').on('click',function(){
   alert('!'); //this one of course happens before the redirect
   $( "#dialog-confirm" ).dialog({...}); //this one shows and is immediately redirected
});
我如何才能满足我的需求?

我通过以下方式来管理它:

$('.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;
});