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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:23:43+00:00 2026-06-17T10:23:43+00:00

I have an object tag on my page with SVG graphics in it: <object

  • 0

I have an object tag on my page with SVG graphics in it:

<object data="graphics.svg" type="image/svg+xml" id="graphics" />

I would like to execute some code which needs svg file to be completely loaded. So using jQuery I put:

$('#graphics').load(function() {
    // some code
})

And using native JavaScript I put:

$('#graphics')[0].addEventListener('load', function() {
    // some code
});

Now the second snippet works and the first does not. What do I miss here?
I supposed embed tag would provide another behavior but it seems there is no difference.

  • 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-17T10:23:44+00:00Added an answer on June 17, 2026 at 10:23 am

    From the jQuery docs:

    Caveats of the load event when used with images
    A common challenge developers attempt to solve using the .load() shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:

    • It doesn’t work consistently nor reliably cross-browser

    • It doesn’t fire correctly in WebKit if the image src is set to the same src as before

    • It doesn’t correctly bubble up the DOM tree

    • Can cease to fire for images that already live in the browser’s cache

    AND:

    The load event is sent to an element when it and all sub-elements have been completely loaded. This event can be sent to any element associated with a URL: images, scripts, frames, iframes, and the window object.

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

Sidebar

Related Questions

I have json object that I would like to put in may page in
I have an object type Page and an action type Create and I would
I have an svg graphics inserted in the page with an embed or object
I have overriden lead object standard detail page with my vf page using tag
I have two models, Image and Tag . Each Image object can have more
I have the following Silverlight control defined: <object id=objImageViewer data=data:application/x-silverlight-2, type=application/x-silverlight-2 width=100% height=500px> <param
new here and having a problem with the object tag. I have a page
I have an HTML page which contains an Object tag to host an embedded
I have a DOMstring object, text of some web page which I get from
I have created an object at runtime by using innerHTML tag, now I want

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.