Problem with opening dialog 2nd time

Problem with opening dialog 2nd time

Hi folks!

I have a problem with opening dialog second time. I have a button which open dialog but it works every time only one, and if I close this dialog I can´t open it second time, before refreshing page.

Can someone help me with this? Thx

Here is code:

<script type="text/javascript" >
    $(document).ready(function(){
        //define config object
        var dialogOpts = {
            modal: true,
            bgiframe: true,
            autoOpen: false,
            height: 420,
            width: 350,
            draggable: true,
            resizeable: true,
           
            open: function() {
                //display correct dialog content
                $("#example").load("pages/add_modul.php<? echo URL::getURL(); ?>");}
        };
        $("#example").dialog(dialogOpts);

       
        $('#showdialog')
        .click(function (){
            $("#example").dialog("open");
           
            //alert('/0');
            return false;
        }
    );
    });

</script>

<a href="" id="showdialog">OPEN</a>
<div id="example" title="title"></div>