Error: Syntax error, unrecognized expression: I want to display a form in CTool modal dialog, but failing badly.

When I click link to show modal form, ajax request is started: 

POST http://drupal.dev/my_mod/arg1/ajax/arg3

and returns:

Error: Syntax error, unrecognized expression: &lt;div id="ctools-modal"&gt; 
&lt;div class="ctools-modal-dialog"&gt;      &lt;div class="modal-content"&gt;    
&lt;div class="modal-header"&gt;          &lt;button type="button"
class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
&lt;h4 id="modal-title" class="modal-title"&gt;&amp;nbsp;&lt;/h4&gt;        &lt;/div&gt;    
&lt;div id="modal-content" class="modal-body"&gt;        &lt;/div&gt;      &lt;/div&gt; 
&lt;/div&gt;  &lt;/div&gt;


I tried to click different link, but gets an error:


  TypeError: Drupal.CTools.Modal.modal is undefined


Code: 

function my_mod_menu() {
  return array(
    'my_mod/%/%ctools_js/%' =&gt; array(
      'title' =&gt; 'Entity Modal Edit',
      'page arguments' =&gt; array(1,3),
      'page callback' =&gt; 'my_mod_modal_page_callback',
      'access callback' =&gt; 'my_mod_modal_access_callback',
      'access arguments' =&gt; array(1,2,3),
      'type' =&gt; MENU_CALLBACK,
    ),
  );
}

function my_mod_modal_page_callback($entity_type, $id) {
  ctools_include('modal');
  ctools_include('ajax');
  ctools_modal_add_js();

  $form_state['user'] = user_load($id);
  $output = ctools_modal_form_wrapper('my_mod_form', $form_state);
  ctools_modal_render('Edit', $output);
  exit;  
}


I'm creating my edit link in custom views_field_handler:

class my_mod_handler_field_links extends views_handler_field {

  function init(&amp;$view, &amp;$options) {
    parent::init($view, $options);

    if (! isset(self::$some_property)) {
      ctools_include('modal');
      ctools_include('ajax');
      ctools_modal_add_js
    }
  }



  function render($values) {

    $edit_link = array(
      'href' =&gt; 'my_mod_ctools/some_value1/nojs/some_other_value',
      'title' =&gt; t('edit'),
      'attributes' =&gt; array('class' =&gt; array('mymod-ctools-links', 'ctools-use-modal', 'use-ajax')),
    );

    $links[] = $edit_link;

    $build = array(
      '#prefix' =&gt; '&lt;div class="mymod-ctools-links-wrapper"&gt;',
      '#suffix' =&gt; '&lt;/div&gt;',
      '#theme' =&gt; 'links',
      '#links' =&gt; $links,
    return drupal_render($build);
  }

  function query() {}

}
I had using jQuery 1.9. I changed it to 2.1 and the problem is solved (jquery_update module)