The title is pretty self-explanatory, I would like to do something like this to display a jQuery UI dialog:
function my_ajax_page_callback() {
drupal_add_library('system', 'ui.dialog');
drupal_add_js('jQuery.dialog(...)','inline');
}
Specifically, I would like to include the library on-demand, not on every non-ajax request. Is that possible in D7?