Using Ajax and returning json array in laravel 5

后端 未结 6 597
粉色の甜心
粉色の甜心 2021-01-02 05:27

\"enterI am new to \"AJAX\" and I have been trying to send a request \"ONSELECT\" using \"AJAX

6条回答
  •  情深已故
    2021-01-02 05:45

    You made error in code ,please write it properly.

    $.ajax({
        type    :"POST",
        url     :"http://localhost/laravel/public/form-data",
        dataType:"json",
        data    :{ data1:data },
        success :function(response){
        alert("thank u");
        }
    });
    

    Update

    I just saw your Returning datatype is json , so use

     dataType:"json",
    

    or

     dataType:"jsonp",
    

提交回复
热议问题