vex confirm dialog, how can i manage the a href-event handling
문제
I'm trying to use https://github.com/HubSpot/vex modal script for a confirm-dialog. If cancel is selected, the event of the href should cancel.
My a href:
<a href="goto.php" class="confirm" >confirm</a>
and my javascript:
$('a.confirm').click(function() {
var page = $(this).attr('rel');
vex.dialog.buttons.YES.text = 'Cancel';
vex.dialog.buttons.NO.text = 'Go further';
vex.dialog.confirm({
message: 'Are you sure to go?',
callback: function(value) {
if(value === false) {
//load the a href-site
} else {
// cancel;
return false;
}
}
});
});
Unfortunately the a href-site will just loaded after i click on the confirm-link. Do anybody can say me how a can change this event-handling?
thanks in advance.
best regards thomas
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow