I'm tring to create a jquery ui dialog without having a empty div container for the dialog in the HTML. For some reason, the global variable isn't recognized in other javascript functions (besides the original javascript function).
var $signOutDialog = null;
function createDialog() {
var $signOutDialog = $("<p></p>").dialog({
resizable: false,
title: 'Sign Out',
width: 830,
autoOpen: false,
modal: true,
});
}
and then i have another javascript function which gets called as a result of a $.ajax success delegate. the $signOutDialog global variable is NULL in this function.
function test2() {
$signOutDialog.dialog('close');
}
any known solution for closing a jquery ui dialog without having the dialog as an empty html element?