jQuery – Multiple Dialoogs Opening External Content

Believe it or not, I was pulling what little hair I had out on this one but the solution is very simple. I was trying to enable jQuery dialogs to open external content for several links on a page.

HTML

<a href="http://www.yourwebsite.com">Your Website Text</a>

jQuery

$(function() {
    $("#category_edit_dialog").dialog({
        width: 960,
        hide: 'slide',
        autoOpen: false
    });

    $('a.dialogLink').click(function() {
        var url = $(this).attr('href');
        $('#category_edit_dialog').load(url, function() {
            $('#category_edit_dialog').dialog('open');
        });
        return false;
    });
});