将“key”变量放置在此字符串内时,它显示“simplelogin%3A5”而不是“simplelogin:5”。有没有办法只传递后者?
var populateTasks = function(date, key){
$scope.ref = new Firebase("https://myfirebase.firebaseio.com/users/"+key+"/tasks");
};
结果:https://myfirebase.firebaseio.com/users/simplelogin%3A5/tasks 我需要:https://myfirebase.firebaseio.com/users/simplelogin:5/tasks
最佳答案
var uri = "//what you need to convert";
var uri_dec = decodeURIComponent(uri);
var res = uri_dec;
关于javascript - 传递 key 会导致我的 firebase URL 中出现多余字符,如何删除它们?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25965144/