开发者

Javascript - Replace '%20' spaces

开发者 https://www.devze.com 2023-01-06 03:29 出处:网络
var loc_array = document.l开发者_Python百科ocation.href.split(\'/\'); var linkElement = document.getElementById(\"waBackButton\");
var loc_array = document.l开发者_Python百科ocation.href.split('/');
var linkElement = document.getElementById("waBackButton");
var newT = document.createTextNode(loc_array[loc_array.length-2]); 
var repl = newT.replace('%20',' ');
linkElement.appendChild(repl);

Anyone know why this causes the text to not show up?


Why not just do

unescape(document.location.href);
0

精彩评论

暂无评论...
验证码 换一张
取 消