views:

88

answers:

1

I am using modal dialog box from jQuery UI. I want to make a ajax call to display the content in my dialog box.

$(function(){
    $('#myLink').live("click", function(){
        $('#lbContent').dialog('open');
        var url= $(this).attr("href");
        $('div#lbContent').empty();
        $('div#lbContent').load(url);
        return false;
    });

    $('#lbContent').dialog({
        stack:true,
        bgiframe: true,
        autoOpen: false,
        height:500,
        width:700,
        modal: true,
        resizable:true,
    });
});

Now, when I click on the link it displays the content in the modal dialog box as expected.

But when I close that dialog box and again click on the same link then that dialog box is not opening. I tried to give alerts in between.

When I refresh the page and click the link then it works as expected.

A: 

Can't reproduce your problem. Consider adding a condensed sample consisting of javascript + html code which reproduces the problem consistently.

Also add which browser you use. And what if any errors are shown in your error console.

Check http://jsbin.com/opigo for a working sample based on your code.

And http://jsbin.com/opigo/edit to check the code pieces

jitter