Code that runs when an object is fully loaded

Open
#233 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, jquery
Domain
frontend

Research direction

The issue names no repository files, tests, or entry points. Start by reproducing the dynamically inserted object and its jQuery load-listener setup, then define the expected completion behavior before identifying a suitable change and verification approach.

Written by the indexing model from the issue text.

Description

Let's say divSomeObject could be too large to fit in a rectangle that has been allocated for it.

It could have an image in it, so when the object is first created, we have no way of knowing whether or not the contents will fit in the box.

So let's have some code run when the object if fully loaded, using jQuery.

$(divSomeObject).on ("load", function () {
   runSomeCode ();
   });

But this isn't happening.

I've read all I can find on the web about this, but they seem to be concerned with objects that load when the page loads. There's no requirement that this happen at page-load time. Sometimes the objects appear dynamically while the app is running.

I've made sure the object is inserted in the DOM when we set up the listener for the "load" event.

Any suggestions welcome.

Dominant language
HTML
Stars
134
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scripting/Scripting-News

All issues in scripting/Scripting-News

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.