I was unable to figure out why calling setMainWindowSize below from outside of the jQuery function will not work. Somebody help? Thank you.
<script type="text/javascript">
var mainWindowDiv = $('<div />', {'id': 'mainWindow', 'title': 'Main Window'});
$(function (){
$('body').append(mainWindowDiv);
mainWindowDiv.dialog({
position: 'center',
resizable: true,
});
//this would work
setMainWindowSize(800,600);
});
function setMainWindowSize(width, height)
{
mainWindowDiv.dialog('option', 'width', width);
mainWindowDiv.dialog('option', 'height', height);
};
//this will fail
setMainWindowSize(800,600);
</script>