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?
The simplest and easiest way to fix your 404 error code is to redirect the page to another one. You can perform this task using a 301 redirect. What's 301, you may ask? It's a redirect response code that signals a browser that the content has been transferred to another URL.
You might see a 404 error because of a problem with the website, because the page was moved or deleted, or because you typed the URL wrong. 404 errors are less common today than they used to be, as websites now strive to automatically redirect visitors away from deleted pages.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With