vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.72k forks source link

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. #1078

Open lordjoo opened 6 years ago

lordjoo commented 6 years ago

Every Time I press Save To Save Value And Send It To Server It Sent Successful but The Xeditable says Error and " No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access." I am Using Laravel In bAckend this is my laravel function

Route::get("/post",function(Request $r,$name = null){
return App\About::all();
//    return abort("200");
//    return response(['success'=>true,"HTTP status"=>200])->header(['success'=>true])
});

JQuary Code

    $.fn.editable.defaults.mode = 'inline';

    //make username editable

    //make status editable
    $('#status').editable({
        type: 'text',
        title: 'Select status',
        placement: 'right',
        pk: 1,
        display: function(value) {
          $('#dd').text(value);
        },
        ajaxOptions: {
          type: 'get',
          success: function(response,data){
            console.log(response);
            console.log(data);
          }
        },
        url: 'http://localhost:8000/post',
        success: function(response, newValue) {
            console.log(response);
          }
    });