Im trying to open a Jquery confirm box using following code.
var a = $('#confirm')
.data("x","defaultValue")
.dialog('open');
alert(a.data("x"));
Inside the dialog I tried to change the value of x.
$("#confirm").dialog({
resizable: false,
autoOpen: false,
height: 180,
width: 400,
modal: true,
buttons: {
"Leave the page": function() {
$(this).data("x","this is a test");
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
});
How can I get the modified value for x. at the moment the alert shows "DefaultValue". But want to get the "This is a test".
Any thoughts?
PS: I just can't redirect using window.open() inside the dialog.