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 7769307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:07:39+00:00 2026-06-01T16:07:39+00:00

Does the <img> tag have an onsuccess attribute? Like onerror . I am loading

  • 0

Does the <img> tag have an "onsuccess" attribute? Like "onerror".

I am loading an image. I bind an event with JQuery, which changes image onerror.
i want to show an alert "ONERROR Image loaded successfuly" if onerror image successfully loaded. Otherwise it will show alert "ONERROR image not found".

EDIT:
onload shows alert after loading image. but didn’t tells us that "your real image is loaded" or "browser's default error image is loaded". check here…

http://jsfiddle.net/extremerose71/cHuu6/6/
  • 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-01T16:07:40+00:00Added an answer on June 1, 2026 at 4:07 pm

    If you wrote something like:

    <img id="im3" src="http://ssl.gstatic.com/gb/images/j_f11bbae8.png" />​
    

    And also wrote:

    $(window).load(function() {
       $("#im3").load( function (){
          alert('load');
       }).error( function (){
          alert('error');
       });
    });
    

    (as in jsfiddle onLoad is corresponded to $(window).load) , you will never get any alert, because $(window).load will be called after all resources is already loaded.

    But if you would remove src from img:

    <img id="im3"/>​ 
    

    And then add this

    $("#im3").attr('src','http://ssl.gstatic.com/gb/images/j_f11bbae8.png' )​​​​​​​​​​​​​​;
    

    line after the load and error listeners , you will see an alert.

    So the main problem was , that you were adding listeners after the image has already loaded or failed to load.

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

Sidebar

Related Questions

Does asp:Image tag perform faster than normal HTML img tag? I have 20 images
I have the following image tag in a JSP: <img id=validationGraph src=/myapp/MyServlet?mode=myMode usemap=#validationMap border=0
I have a facebook og tag... <meta property=og:image content=whatever.jpg/> And I'd like to change
If I have an img tag like <img src=example.png /> and I set it
I have added an img tag inside title attribute,but the img tag shows as
The body-Tag of a HTML-File does have a background-image applied: body {… background: #fff
Does anyone use have a good regex library that they like to use? Most
I have a php code which generate an gif-image defined by a set of
I have an image inside a span tag, the span has a set width
I am have buttons like this: <button type=button class=img img_button_bla onclick=...>Bla!</button> The img class

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.