检查文件是否存在,但防止控制台出现404错误 [英] Check if file exists but prevent 404 error in console from showing up

查看:114
本文介绍了检查文件是否存在,但防止控制台出现404错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过JavaScript检查文件/页面是否存在但是阻止404错误显示在控制台中?

Is it possible to check to see if a file/page exists via JavaScript but prevent the 404 Error from showing up in the console?

推荐答案

似乎答案是:否。无法避免在控制台中出现404错误,除非您启动对服务器端脚本的调用以检查文件是否存在。

Seems like the answer is: No. Can't avoid getting a 404 error in the console unless you kick off a call to a server-side script to check file existence.

这篇关于检查文件是否存在,但防止控制台出现404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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