js中url解码

var name = window.location.search.substr(4,30);
//name = decodeURI(name);
//使用示例
document.getElementById('username').innerHTML = decodeURI(name);

posted @ 2014-12-02 23:28  KoMiles  阅读(494)  评论(0编辑  收藏  举报