weixin_33736649 2012-11-19 07:29 采纳率: 0%
浏览 354

路径中包含非法字符?

I have following scripts:

function PostChartValues(meter_id, range_type_id, start_date, end_date) {
    $.ajax({
        url: '@Url.Action("GetMeterReadingsTimeSeries", "Widget")',
        type: 'POST',
        data: { MeterType: meter_id, DateRangeType: range_type_id, StartDate: start_date, EndDate: end_date },
        beforeSend: function () {
            $("#chart_loading_div").show();
        },
        complete: function () {
            $("#chart_loading_div").fadeOut();
         },
        success: function (result) {
            $("#chart").html(result);
        },
        error: function (result) {
            alert("Seçilen kritere uygun veri bulunamadı!");
        }
    }); //end ajax
} //end PostChartValues

code is working. But When I receive an external .js file above code, I get the error that I wrote in the title.

Why do I get this?

  • 写回答

2条回答 默认 最新

  • 谁还没个明天 2012-11-19 07:36
    关注

    You have asp.net code in there, asp.net-mvc doesn't parse external js files so you'll actuall be trying to make a request to @Url.Action("GetMeterReadingsTimeSeries", "Widget") which is not a valid url. You'll have to manually write the results of Url.Action("GetMeterReadingsTimeSeries", "Widget") in you js file.

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?