title: Cannot load modal popup in cakephp 3
body: <p>I want to load modal pop up on click of an edit link. But it takes to new page. I have used e.preventDefault() function but it is not working. Below is my code.
  It is taking me to <a href="http://localhost/projectname/PanelAdmin/Products/edit/1" rel="nofollow noreferrer">http://localhost/projectname/PanelAdmin/Products/edit/1</a>. Please help to solve my issue i am new to cakephp.</p>
  
  <blockquote>
    <p>View.ctp</p>
  </blockquote>
  
  <pre><code>&lt;li&gt;
            &lt;?php              
            echo $this-&gt;Html-&gt;link("Edit Profucts","/PanelAdmin/Products/edit/".$prod-&gt;product_id, array('update' =&gt; '#flexModal','htmlAttributes' =&gt; array('data-toggle' =&gt; 'modal','data-target' =&gt; '#flexModal')));
                ?&gt;
      &lt;/li&gt; 
  
  &lt;script&gt;
  $(document).ready(function() {
      $("a[data-target=#flexModal]").click(function(ev) {
          ev.preventDefault();
          $("#flexModal .modal-body").load(target, function() {
              $("#flexModal").modal("show");
          });
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <blockquote>
    <p>View: edit.ctp</p>
  </blockquote>
  
  <pre><code>&lt;div class="modal" data-target="#flexModal" tabindex="-1" role="dialog" data-backdrop="static"&gt;
      &lt;div class="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;h3 class="modal-title" id="myModalLabel"&gt;&lt;/h3&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
  
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <blockquote>
    <p>ProductsController.php</p>
  </blockquote>
  
  <pre><code>public function edit()
  {
      $this-&gt;render('edit', 'ajax');
  }
  </code></pre>