备记location.href

今天遇到个问题.

使用window.location.href 时

如果url是encode过的.

如window.location.href=”http%3A%2F%2Fmusic.sina.com.cn%2Fmycd%2Fceb%2Fnewcardinfo.php”

假设使用js的页面是http://test.html

会出现http://test.htmlhttp%3A%2F%2Fmusic.sina.com.cn%2Fmycd%2Fceb%2Fnewcardinfo.php

页面找不到.

总结.使用window.location.href时.如果值是一个完整的url .不应该做urlenocode.