Open a jQuery modal dialog box on a certain variable value
<p>I need to open a jQuery modal dialog box on a certain variable value.</p>

<pre><code>$(function() {  
    // Dialog           
    $('#GenerateCode').dialog({
        autoOpen: false,
        width: 600,
        title : 'Table'
    });
});

function openDialog(publicId) {
    $('#GenerateCode').dialog('open');
}

&lt;div style='display: none;' id='GenerateCode'&gt; Here I need  code &lt;/div&gt;
&lt;p&gt;
    &lt;a onclick=openDialog("'. $publicId .'") href="#" id="dialog_link"&gt; code generate &lt;/a&gt;
&lt;/p&gt;
</code></pre>

<p>When a user clicks on <code>#GenerateCode</code> I need to show below code and replace <code>$publicId</code> with what ever value he clicked on in a dialog box</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var Protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
    document.write(unescape("%3Cscript src='" + Protocol + "www.abc.com/Tracker.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    &lt;!--
    Tracker($publicId);
    //--&gt;
&lt;/script&gt;
</code></pre>
