how to open jquery ui dialog automatically when the page loads?
- by rgksugan
I need my dialog to open when the page is loaded automatically. What is the way to do it using jquery. Without any user interaction to open it.
I tried this code but it dint work
<script type="text/javascript" src="script/jquery-1.4.2.min.js"></script>
<link type="text/css" href="css/jquery-ui-1.8.1.custom.css" rel="stylesheet" />
<script type="text/javascript" src="script/jquery-ui-1.8.1.custom.min.js"></script>
<script type="text/javascript" src="script/jquery-ui.dialog.js"></script>
<script type="text/javascript" src="script/jquery.bgiframe-2.1.1.js"></script>
<script type="text/javaScript">
$(function(){
$('#dialog').dialog({
autoOpen: false,
width: 600,
buttons: {
"Ok": function() {
$(this).dialog("close");
}
}
});
$('#dialog').dialog('open');
});
</script>
Please help.