I've got a custom template page I am building for any wordpress site (utilizing a modified Twenty Eleven theme). Within the page you will find links which are produced programmaticly. You will see several links similar to this:

<a href="http://www.site.com.com/info.php?id=123" class="uimodal">More Information</a>

I'd like any URL using the class of uimodal in the future up inside a jQuery UI modal window (dialog) but I am getting problems setting it up to do this.

I have effectively loaded jQuery UI. I've attempted several code clips online, not receiving any errors via Firebug, it simply does not load modal (just replaces the present page).

Any assistance is appreciated!


Try something similar to this: http://jsfiddle.net/hSRdr/

$(function() { // same as $(document.ready(function() {
    $('a.uimodal').on('click', function() {
        var href = $(this).attr('href');

        $('<div>').append('<iframe src="' + href + '"></iframe>').dialog();
        return false;