Modal dialog doesn't work I want to display ctools modal. I tried the following code.

/**
 * Implements hook_menu().
 */
function my_module_menu() {
  $items['my_module/%ctools_js/test-page'] = array(
    'title' =&gt; 'Demo CTools Page',
    'page callback' =&gt; 'my_module_modal',
    'page arguments' =&gt; array(1),
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
  );

  return $items;
}

function my_module_modal($js) {
  $output = '&lt;div class="content"&gt;' . t('Test content?') . '&lt;/div&gt;';
  dsm($js);
  if ($js) {
  ctools_include('ajax');
    ctools_include('modal');

  ctools_modal_add_js();
    return ctools_modal_render('Define as start matrix', $output);
  }

  return $output;
}


The link where I click is

&lt;a href="/my_module/nojs/test-page" class="ctools-use-modal"&gt;Open modal&lt;/a&gt;


But it returns me only the content of the page with no modal.
When I printed the $js variable, it is displaying 0. While the javascript is enabled in the browser. I have checked it with multiple browsers .

What can be the issue?
I have found the solution.

You need to add these 3 lines of code to the page where the link &lt;a href="/my_module/nojs/test-page" class="ctools-use-modal"&gt;Open modal&lt;/a&gt; is displaying.

ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();