• js传递参数中包含+号时的处理方法


    encodeURI(url).replace(/+/g, '%2B')

    例子:

    $scope.getAnesthesiawaystatistical = function (annual, anesthesiaMethodRep) {
    var Anesthesiurl = "/api/v1/AnesthesiAwayStatistical/GetAnesthesiAwayStatisticalCount?anesthesiaMethodRep=" + "'" + anesthesiaMethodRep + "'" + "&annual=" + annual;
    alert(encodeURI(Anesthesiurl).replace(/+/g, '%2B'));
    $http.get(encodeURI(Anesthesiurl).replace(/+/g, '%2B')).success(function (data) {

    if (data.has_val) {
    $scope.AnesthesiAwayStatisticalList = data.result;

    console.log($scope.AnesthesiAwayStatisticalList);
    }
    });
    }

  • 相关阅读:
    channel分析
    Nginx|基础
    item2
    搜索引擎技巧
    计算机网络|概述
    操作系统|进程
    分布式事务一致性
    画图工具StartUML
    内存分配
    MPG分析
  • 原文地址:https://www.cnblogs.com/zhangxiaolei521/p/6208491.html
Copyright © 2020-2023  润新知