Javascript - 替换'%20'空格

bal*_*der 2 javascript dom replace

var loc_array = document.location.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);
Run Code Online (Sandbox Code Playgroud)

任何人都知道为什么这会导致文本不显示?

Rob*_*sto 9

为什么不这样做呢

unescape(document.location.href);
Run Code Online (Sandbox Code Playgroud)