window.location.href跳转至空白页

现象:window.location.href = "XXX"调到了空白页,但是将XXX在窗口地址栏输入就会可以访问到。

原因:就是XXX前缀没有加上“http://”,在地址栏中默认会加上“http://".

原文地址:https://www.cnblogs.com/codeww/p/7449009.html