function newbox(Title, Messagetext) {
$(document).ready(function () {
$("#div1").text(Messagetext);
$("#div1").dialog({
modal: true,
title: Title,
buttons: {
Ok: function () {
enbleButton();
$(this).dialog("close");
//self.close();
}
}
});
});
}
given newBox function is used to show modal popup. this function totally fine if called inside $(document).ready() like this
$(document).ready(function () {
newbox('test', 'niraj');
});
but doesn't work when i call it through javascript function like :
function test()
{
$(document).ready(function () {
newbox('test', 'niraj');
});
return false;
}
im using IE8, jQuery 1.10.2 and jQuery UI 1.11.4
Update:
My HTML:
<div style="display:none;">
<div id="dialog-message">
test text
</div>
<div id="div1">
test text
</div>