title: e.preventDefault not working on laravel 5.7
body: <p>I'm doing chat app Laravel 5.7 and having a challenge with jQuery AJAX function.</p>
  
  <p>I'm using PHP version 7.1.9 with 3.x version of jQuery.</p>
  
  <p>Here's my form with the AJAX request:</p>
  
  <pre><code>&lt;form action="/channels/{{$channel-&gt;id}}" method="POST"&gt;
    &lt;input type="hidden" name="_token" value="{{ csrf_token() }}" /&gt;
    &lt;input type="hidden" name="user_id" value="{{Auth::user()-&gt;id}}" /&gt;
    &lt;input type="hidden" name="channel_id" value="{{$channel-&gt;id}}" /&gt;
    &lt;input type="hidden" name="user" value="{{Auth::user()-&gt;name}}" /&gt;
    &lt;input type="text" name="msg" class="form-control msg" /&gt;
    &lt;input type="submit" value="Envoyer" class="btn send-msg" /&gt;
  &lt;/form&gt;
  &lt;script type="text/javascript"&gt;
    $(document).ready(function() {
      $.ajaxSetup({
        headers: {
          "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
        }
      });
      $(".send-msg").click(function(e) {
        e.preventDefault();
        var user_id = $("input[name='user_id']").val();
        var channel_id = $("input[name='channel_id']").val();
        var user = $("input[name='user']").val();
        var msg = $("input[name='msg']").val();
        $.ajax({
          type: "POST",
          url: "/channels/{{$channel-&gt;id}}",
          data: {
            msg: msg,
            user: user,
            channel_id: channel_id,
            user_id: user_id
          },
          success: function(data) {
            alert(data.success);
          }
        });
      });
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>And my PHP code:</p>
  
  <pre><code>public function sendmessage(Request $request){
    $message = new Messages();
    $message-&gt;channel_id = $request-&gt;channel_id;
    $message-&gt;user_id = $request-&gt;user_id;
    $message-&gt;username = $request-&gt;user;
    $message-&gt;message = $request-&gt;msg;
    $message-&gt;save();
    return response()-&gt;json(['success'=&gt;'Got Simple Ajax Request.']);
  }
  </code></pre>
  
  <p>Normally, it should post an alert with data, but actually, it redirect me to <code>/channels/{id}</code> with <code>json : success: Got Simple Ajax Request</code></p>
  
  <p>What am I doing wrong and how can I fix it?</p>