Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7898009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:19:04+00:00 2026-06-03T08:19:04+00:00

For example in javascript var image = new Image(); image.onerror = function(e) { //

  • 0

For example in javascript

var image = new Image();
image.onerror = function(e) {
    // handle error my way
}
image.src = "http://bad.location.com/img.jp"

I’ve tried

e.preventDefault()
return false

but the error is still logged to the console. Maybe this is not such a bad thing but what I’m doing is uploading files to the server and then processing them and loading the artifacts to S3. This all takes a long time. I do this in the background and return the S3 URL’s to the browser early and use some javascript to ping the image urls using the image.onerror callback to detect if the image is arrived on S3 or not.

It all works but I get a load of console errors. This is a bit ugly. Is there any way
to hide this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:19:06+00:00Added an answer on June 3, 2026 at 8:19 am

    Sorry there is seemingly no way to suppress that error, at least in Google Chrome.

    See also: Check if file exists but prevent 404 error in console from showing up

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given remote page: http://example.com/paged_list.aspx which uses a Javascript function call to display several pages
var img = new Image(); img.src = '/images/backdrop.jpg'; ctx.drawImage(img,0,0); I wanted to load an
While reading a book about JavaScript I stumbled across an example: var names =
For example if JavaScript performs a bunch of manipulations on a table, the new
Javascript jQuery event handling If on event (for example 'click') bound one function for
It is valid JavaScript to write something like this: function example(x) { Here is
Is there any javascript function that can encrypt data: For example i want to
I am trying to use JavaScript to upload image to imgur by this example
How do I develop a working example using this plugin: HTML5 JavaScript Pasting Image
In the wikipedia entry Unobtrusive JavaScript there is an example of obtrusive JavaScript: <input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.