当我首先过滤数据时,其URL就像这种类型
app.controller('CustSignupCtrl', ['$scope', '$filter','frontendService', '$http', 'editableOptions', 'editableThemes','notify','notification','$appConstants',
function('$scope', '$filter','frontendService', '$http','editableOptions', 'editableThemes','notify','notification','$appConstants'){
$scope.pw1 = '';
$scope.registerCustomer = function (data) {
return frontendService.registerCust(data)
}
$scope.signupcustomer = function(){
var payload= {
first_name: $scope.custForm.fname,
last_name: $scope.custForm.lname,
phone: $scope.custForm.phone,
email:$scope.custForm.email,
username:$scope.custForm.username,
password:$scope.custForm.pw1,
usertype:3
}
console.log("inside function");
$scope.registerCustomer(payload).then(function(data){
notification.success(data.result);
},function(err){
notification.error("Error: contact system admin");
});
}
}
])
但是当我第二次过滤时,它的URL就像这样
"http://localhost/computers?specs=Category:intel!!0!!".
所以我想这样做,如果我第二次过滤删除' ??' (问号)两个中的一个。这是代码 `
"http://localhost/computers??specs=Category:intel!!0!!".
`删除尾随'?'来自网址,如果有的话
答案 0 :(得分:0)
试试这个
URL = url.replace(" ??",?)