gpt4 book ai didi

javascript - 传递 key 会导致我的 firebase URL 中出现多余字符,如何删除它们?

转载 作者:行者123 更新时间:2023-12-02 16:58:35 25 4
gpt4 key购买 nike

将“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/

25 4 0
文章推荐: javascript - 当视口(viewport)更改大小时,我可以使用 JQuery 或 JavaScript 将
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com