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);
}
});
}
时间: 2024-10-20 11:30:16