Jquery modal popup not working
<p>The popup works when I use it alone like with an input button. But when there is additional code it stops working.  Here is the code for the popup:</p>

<pre><code>function kopen() {
    $('#MyDialog').html("&lt;body id='boot'&gt;&lt;canvas id='myCanvas' width='350' height='100'&gt;&lt;/canvas&gt;&lt;/body&gt;");
    myCanvas = document.getElementById('myCanvas');
    ctx1 = myCanvas.getContext('2d');
    $("#MyDialog").dialog({
        modal : true,
        height : 250,
        width : 505,
        open : function (event, ui) {
            $(this).closest('.ui-dialog').find('.ui-dialog-titlebar-close').hide();
        },
        autoOpen : true
        // ^^^^^^^^^^^
    });
}
</code></pre>