title: Why my page gets refresh while deleting image on 'product edit page'?
body: <p><strong>VIEW FILE</strong></p>
  <pre><code>&lt;div class=&quot;col-sm-4&quot;&gt;
          &lt;label&gt;Other Images&lt;/label&gt;
          &lt;div class=&quot;input-group control-group img_div form-group&quot; &gt;
          &lt;input type=&quot;file&quot; name=&quot;image[]&quot; class=&quot;form-control&quot;&gt;
          &lt;div class=&quot;input-group-btn&quot;&gt; 
          &lt;button class=&quot;btn btn-success btn-add-more&quot; type=&quot;button&quot;&gt;Add&lt;/button&gt;
          &lt;/div&gt;
          &lt;/div&gt;
          &lt;/div&gt;
          &lt;div&gt;@foreach($image as $image)
          &lt;p&gt;&lt;img src=&quot;{{asset('/files/'.$image-&gt;images)}}&quot; height=&quot;50px&quot; id=&quot;{{$image-&gt;id}}&quot; class=&quot;photo&quot;/&gt;
          &lt;button class=&quot;removeimg&quot; data-id=&quot;{{$image-&gt;id}}&quot; data-token=&quot;{{ csrf_token() }}&quot;&gt;Remove&lt;/button&gt;&lt;/p&gt;
          @endforeach
          &lt;/div&gt;
  </code></pre>
  <p><strong>AJAX</strong></p>
  <pre><code>$(document).ready( function () {
      $(document).on('click', '.removeimg',function(){
          var confirmation = confirm(&quot;are you sure to remove this record?&quot;);
          if (confirmation) {
          var id = $(this).data(&quot;id&quot;);
          // console.log(id)
          var token = $(this).data(&quot;token&quot;);
          var $obj = $(this);
          $.ajax(
          {
              url: &quot;{{ url('image/delete') }}/&quot;+id,
              type: 'post',
              dataType: &quot;JSON&quot;,
              data: {
                  &quot;id&quot;: id,
                  &quot;_token&quot;: token,
              },
              success: function (res)
              {
                  // $(this).parents('.photo').remove();
                  $obj.parents('.photo').remove();
                  console.log(&quot;it Work&quot;, res);
              }
          });
          console.log(&quot;It failed&quot;);
      }
      });
  });
  </code></pre>
  <p><strong>CONTROLLER</strong></p>
  <pre><code>public function imgdelete($id){
          Image::find($id)-&gt;delete($id);
          return response()-&gt;json([
              'success'=&gt; 'Image deleted successfully!'
          ]);
      }
  </code></pre>
  <p>When I delete the image, page gets redirected to product listing. Page should not get refresh when I delete the image. Can you please help me with correction?? NOTE: This process takes place on editproduct page.</p>