Reputation: 49361
Hi I have an anchor that I am trying to get a JConfirm box to work with, But Its just popping up and disappearing. There is an image in the anchor with an "X"
onclick='jConfirm("Do you really want to do that?.\n ","Import",
e.preventDefault();
if(!ans) {
return false;
}
});'>
Upvotes: 0
Views: 645
Reputation: 49361
This works
$('.deleteconfirm').click(function(e)
{
link = this;
url=link.getAttribute('href')
e.preventDefault();
jConfirm(("Delete this Report Association?"),'Report',function(confirmed)
{
if(confirmed)
{
window.location =url;
}
})
});
Upvotes: 0
Reputation: 17472
try this (untested)... think about what is ans
in your code?
jConfirm('Do you really want to do that?', 'Import', function(ans) {
if(!ans) {
return false;
}
});
Also it is always cleaner to do this using delegate
or on
rather than doing inline...
Upvotes: 0