javascript - xhttp.send() get error POST 500 (Internal Server Error) -
when trying send data server error post 500(internal server error ) display here form
<form class="input-group" id="f"> <div class="form" style="display :-webkit-inline-box;"> <input type="text" class="form-control" name="comment" placeholder=" comment "> <span class="input-group-btn"> {{--<input class="btn btn-default" type="button" onclick="loaddoc()" value="comment!">!--}} <input class="btn btn-default" type="button" onclick="loaddoc()" value="comment!"> </span> </div> <input type="hidden" name="_token" value="{{ csrf_token() }}"> </form><!-- /input-group -->
and javascript code
function loaddoc() { var dd = document.getelementbyid('f'); var d = []; r=0; (var = 0; < dd.elements.length; i++){ if(dd[i].type == "text") { d[r] = dd[i].value; r++; } } var xhttp = new xmlhttprequest(); var url = "/place/{{$place->id}}"; var params = "data="+d; xhttp.open("post", url , true); xhttp.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhttp.onreadystatechange = function() { if (this.readystate == 4 && this.status == 200) { var json = json.parse(this.response); console.log(json); } }; xhttp.send(params); }
i trying make comment .... in advanced
Comments
Post a Comment