最近在调整某个网站时,点击某个栏目时发现无法进入到选择的栏目,点击右键打开新链接时又可以。看网址是没有问题的,真是奇了怪了。F12进入浏览器开发工具后发现,点击栏目时报了错误,显示:Failed to launch 'localhost:9093' because the scheme does not
后来发现原来是自己把链接写错了,写的是<a href="localhost:9093/index.php?tid=32" 正确的是应该是 <a href="http://localhost:9093/index.php?tid=32",前面没有加http或https,问题是没写协议头。
Failed to launch错误的原因
控制台报错: Failed to launch ‘xxx’ because the scheme does not have a registered handler.
这种错误是因为请求没有协议,应该把协议头加上
错误的例子:window.location.href="localhost:9093/index.php?tid=32"
正确的例子:window.location.href="http://localhost:9093/index.php?tid=32"