最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dom - Javascript - Replace '%20' spaces - Stack Overflow

programmeradmin3浏览0评论
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);

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

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);

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

Share Improve this question asked Jul 9, 2010 at 17:21 balexanderbalexander 24.5k14 gold badges47 silver badges68 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 9

Why not just do

unescape(document.location.href);
发布评论

评论列表(0)

  1. 暂无评论