我正在尝试将这个Tagify脚本从一个数组转换为一个字符串。问题是,所有来自Tagify的输出都包含值和逗号,我到目前为止无法将这些数组转换为漂亮的字符串。我该怎么做?
我正在使用该脚本创建标签,然后在搜索(GET)中使用它们。我在URL中得到了这个:
我正在使用该脚本创建标签,然后在搜索(GET)中使用它们。我在URL中得到了这个:
?query=[{"value"%3A"bee"}]
而不是?query=bee
var input = document.querySelector('input[name=query]'),
// init Tagify script on the above inputs
tagify = new Tagify(input, {
// after 2 characters typed, all matching values from this list will be suggested in a dropdown
whitelist: ["Door", "Cat", "Mouse", "Chicken", "Duck"]
})
location
与tagify.value
的代码。这是需要完成的关键点。 - vsync