JQuery Ajax call gives 404 'Resource Not Found' Error but normal URL call is fine

前端 未结 7 2469
别跟我提以往
别跟我提以往 2020-12-31 18:29

I have a weird problem when using JQuery call in my ASP.NET MVC project. I found that the Ajax call gives 404 ( resource not found error). But when I use the usual URL GET c

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 18:51

    Old function :

    function Chart() {
    
        var url = "../Home/Pie/";
        $.ajax({
            url: url,
            data: {},
            cache: false,
            type: "POST",
            success: function (data) {
                var chartData = data;
                createChart(chartData);
                $(document).bind("kendo:skinChange", createChart);
            },
            error: function (xhr, status, error) {
                $('#alertdialog').html(status);
                $('#alertdialog').dialog('open');
                return false;
            }
        });
    }
    

    Answers : var url = "Home/Pie/"; Removed ../ from url

提交回复
热议问题