使用JavaScript的window.open时如何禁用弹出错误消息 [英] How to disable pop-up error message while using window.open of Javascript

查看:61
本文介绍了使用JavaScript的window.open时如何禁用弹出错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



对于此示例,如果不存在"varPath",则会弹出一条错误消息,显示找不到...".

Hi,

For this example, if "varPath" is not existed, it will pop-up an error message shows "Cannot find ...".

function my_test( varPath )
{
   window.open( varPath );
}


因此,我想在使用window.open时禁用弹出错误消息窗口.

我该怎么办?

非常感谢.


So, I want to disable the pop-up error message window while using window.open.

How do I do that?

Many thanks.

推荐答案

您应该专注于编写优质的js,而不是使用不良的代码.您可以在浏览器中将其关闭,但我认为您无法使用代码将其关闭.
You should concentrate on writing good js, not living with bad code. You can turn this off in the browser, but I don''t think you can turn it off with code.


这篇关于使用JavaScript的window.open时如何禁用弹出错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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