$('a.modalButton').on('click', function(e) {
    var src = $(this).attr('data-src');
    var height = $(this).attr('data-height') || 300;
    var width = $(this).attr('data-width') || 400;
    
    $("#myModal iframe").attr({'src':src,
                        'height': height,
                        'width': width});
});

@@ -1,35 +1,22 @@
 $(
-'a.modalButton').on('click', 
+document).ready(
 func
@@ -24,287 +24,453 @@
 ion(
-e
 ) %7B%0A
-    var src = $(this).attr
+%09%0A// Support for AJAX loaded modal window.%0A// Focuses on first input textbox after it loads the window.%0A$
 ('
+%5B
 data-
-src');%0A    var height = $(this).attr('data-height') %7C%7C 300;%0A    var width = $(this).attr('data-width') %7C%7C 400;%0A    %0A    $(%22#myModal iframe%22).attr(%7B'src':src,%0A                        'height': height,%0A                        'width': width%7D);
+toggle=%22modal%22%5D').click(function(e) %7B%0A%09e.preventDefault();%0A%09var url = $(this).attr('href');%0A%09if (url.indexOf('#') == 0) %7B%0A%09%09$(url).modal('open');%0A%09%7D else %7B%0A%09%09$.get(url, function(data) %7B%0A%09%09%09$('%3Cdiv class=%22modal hide fade%22%3E' + data + '%3C/div%3E').modal();%0A%09%09%7D).success(function() %7B $('input:text:visible:first').focus(); %7D);%0A%09%7D%0A%7D);%0A%09
 %0A%7D);

Update modal.js