how to open jquery ui dialog automatically when the page loads?

Posted by rgksugan on Stack Overflow See other posts from Stack Overflow or by rgksugan
Published on 2010-06-06T01:32:33Z Indexed on 2010/06/06 1:42 UTC
Read the original article Hit count: 407

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.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui