Dialog and Live buttons
Dialog and Live buttons
- $('.var_delete').live('click',function() {
$('#dialog').html('Are you sure you want to delete this variable?');
//Request confirmation
$('#dialog').dialog({
autoOpen: true,
draggable: false,
title: 'Delete Variable',
width: 500,
buttons: {
"No": function() {
$(this).dialog("close");
},
"Yes": function() {
$.getJSON(someurl, "", function(data) {
//some additional stuff here
$(this).dialog("close");
});
}
}
});
return false;
});
Above is my javascript, it works once, but if a button is pressed again, it simply carrys out the URL location of the href. What is causing this? I thought by using live it resolved this issue?