I'm trying to use this code to replace spaces with _, it works for the first space in the string but all the other instances of spaces remain unchanged.(我正在尝试使用此代码用_替换空格,它适用于字符串中的第一个空格,但所有其他空格实例保持不变。)
Anybody know why?(谁知道为什么?)
function updateKey()
{
var key=$("#title").val();
key=key.replace(" ","_");
$("#url_key").val(key);
}
ask by Click Upvote translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…