javascript - Can't Perform action on click yes in Jquery based confirmation box -


i have template using fallr confirmation or alert boxes features. has code confirmation box, working fine not working according requirement..means

i have 1 link delete row table like:

<a href="<?php echo base_url(); ?>admin/del_menu/<?php echo $values->id; ?>" rel="tooltip-top" title="delete" id="confirm"> 

when click on showing dialog box ask 'yes' , 'cancel' it's jquery code is:

 $('#confirm').click(function(ev) {                 var clicked = function(){                     $.fallr('hide');                     return true;                 };                   $.fallr('show', {                     buttons : {                         button1 : {text: 'yes', danger: true, onclick: clicked},                         button2 : {text: 'cancel', onclick: function(){$.fallr('hide')}}                     },                     content : '<p>are sure want delete menu?</p>',                     icon    : 'error'                 });                  ev.preventdefault();             }); 

in code want edit 1 thing..link action should perform when click on yes..but have added ev.preventdefault() it's disable link , it's not working on click yes... body knows how handle one?

you can redirect user in clicked handler giving destination of link window.location:

 $('#confirm').click(function(ev) {             var target = $(this).attr('href');             var clicked = function(){                 // redicrect browser given location.                 window.location = target;             };               $.fallr('show', {                 buttons : {                     button1 : {text: 'yes', danger: true, onclick: clicked},                     button2 : {text: 'cancel', onclick: function(){$.fallr('hide')}}                 },                 content : '<p>are sure want delete menu?</p>',                 icon    : 'error'             });              ev.preventdefault();         }); 

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -