Run Javascript Function When Object Content Has Been Loaded July 22, 2023 Post a Comment How do I run a Javascript function when the content of an has been loaded? The DOMContentLoaded event fires before that, and things that rely on it like JQuery's $()Solution 1: Does using the onload DomEvent work? <object onload="changeColor()" data="circles.svg"type="image/svg+xml"id="circles"></object> Copysee my it here Solution 2: You should use onload/ready event of jquery - http://api.jquery.com/ready/Baca JugaUnderstanding Document.createelement()How To Get Computed Style Of A HtmlelementHow To Catch Creation Of Dom Elements And Manipulate Them With Jquery$('#circles').ready(function(){ changeColor(); });` Copy Share You may like these postsWhy It Is Bad Practice To Register Events To Document In Jquery?Attachevent Or Addeventlistener - Stored Where?Using Custom Data-attributes In Html In Onchange EventHow To Identify When The Dom Has Been Changed? Post a Comment for "Run Javascript Function When Object Content Has Been Loaded"