如何设置当前页面即将空白使用JavaScript? [英] How do I set the current page to about:blank using JavaScript?

查看:117
本文介绍了如何设置当前页面即将空白使用JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况,服务器可能不适用于当前的地址,所以我想检测和页面重定向到约:空白页

我怎么会去这样做使用JavaScript?


解决方案

  window.location.href =有关:空白;

I have a situation where the server may not available on the current address, so I want to detect that and redirect the page to an about:blank page.

How would I go about doing that using JavaScript?

解决方案

window.location.href="about:blank";

这篇关于如何设置当前页面即将空白使用JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆