loading contents of variable in div/modal box
<pre><code>$(document).ready(function() {
    var $loading = $('&lt;img src="loading.gif" alt="loading" class="loading"&gt;');

    $('#tire-specs th a').each(function() {
        var $dialog = $('&lt;div&gt;&lt;/div&gt;')
            .append($loading.clone());
        var $link = $(this).one('click', function() {
            $dialog
                .load($link.attr('href') + ' #content')
                .dialog({
                    title: $link.attr('title'),
                    width: 500,
                    height: 300
                });

            $link.click(function() {
                $dialog.dialog('open');

                return false;
            });

            return false;
        });
    });
});
</code></pre>

<p>I have got result using ajax in a variable and i want to put that variable content in the modal box. How do i load content of a variable in the modal box? tried several things , but not getting how do i accomplish it. according to me the following code adds the html contents to the modal box. i need it to be modified for loading variable content.</p>

<pre><code>$dialog.load($link.attr('href') + ' #content').dialog({
              title: $link.attr('title'),
                width: 500,
                height: 300
            });
</code></pre>

<p>The original full code is available at 
<a href="http://blog.nemikor.com/2009/08/07/creating-dialogs-on-demand/comment-page-1/#comment-10676" rel="nofollow">http://blog.nemikor.com/2009/08/07/creating-dialogs-on-demand/comment-page-1/#comment-10676</a></p>

<p>Thanks in advance for any suggestions and help </p>
