【问题标题】:Remove the "amp;" from the URL删除“amp;”从网址
【发布时间】:2020-02-10 01:20:52
【问题描述】:

我使用这个 Jquery:

  $('.FilteredData').change(function () {
            var link = $(this).is(":checked") ? "@Url.Action("DataBlacklist", new { fw=12,id="test" })" : "";
            window.open( link , "_self");
        });

URL 结果是:http://localhost:49173/Operasional/DPWD/DataBlacklist?fw=12&id=tes

我想要这样的结果:http://localhost:49173/Operasional/DPWD/DataBlacklist?fw=12&id=tes

我想删除“amp;”

我该怎么做?

【问题讨论】:

    标签: jquery model-view-controller


    【解决方案1】:

    你可以做一个字符串替换:

      $('.FilteredData').change(function () {
                var link = $(this).is(":checked") ? "@Url.Action("DataBlacklist", new { fw=12,id="test" })" : "";
                link = link.toString().replace('amp','');
                window.open( link , "_self");
            });
    

    【讨论】:

      猜你喜欢
      • 2019-10-29
      • 2014-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多