question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do you plan to handle dynamically loaded HTML

See original GitHub issue

Under the Limitations section I noticed you mentioned that this library does not work for dynamically injected markup, however the library should support this at some point in the future; I was wondering if you had a plan for implementing this. It seems like using MutationObserver is a good idea, as it is widely supported (including back to IE11), and should be able to efficiently listen to DOM mutations. I’m guessing we could observe on document.body or something and listen for childList mutations, determine if a child has the .lazy class, and therefore should also be observed?

Maybe we could make mediaObserver a variable global to this module, so we could .observe future elements that our MO detects. Thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
domfarolinocommented, Mar 7, 2018

Oh nice, sounds fun! Excellent, we shall talk soon then.

And yeah, I’ve been contributing to Chromium + standards a bit. Ah I’m interested in seeing some of the writing if it’s been published yet!

0reactions
malchatacommented, Apr 15, 2018

This has been added in the 2.0.0 release. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling dynamically created HTML in JavaScript - Medium
If you have a JavaScript plugin that needs to keep state, store that state on that element's dataset. Then, in the click handler,...
Read more >
Enhance Aurelia model to handle dynamically loaded HTML
Overview. Prerequisite: have some already-working aurelia app; Import the TemplatingEngine; Insert your dynamic html into the DOM (e.g. via ...
Read more >
Javascript: Increasing performance using Dynamic Loading
Dynamic Script Element ... The Document Object Model (DOM) allows you to dynamically create almost any part of an HTML document using JavaScript....
Read more >
Dynamically Load JavaScript - YouTube
In this video I just go over a couple of ways that you can dynamically load in JavaScript from other JavaScript code.
Read more >
How to Scrape Dynamically Loaded Websites with #Selenium ...
In video #50 on my channel, I used #beautifulsoup to scrape the job listings from two sites to automate my job searching.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found