Skip to content
Advertisement

How to get .load() working within .each() loop?

I’m modifying a bit of code I found here from this question. I am trying to get it working now for multiple instances of a video. This is the only way I can get it working but I would like to make it work for each instance that there is a video which changes on each page this applies on.

JavaScript
JavaScript

I have tried putting it within a loop like this instead of the bgv[0].load(); but it didn’t work:

JavaScript

Advertisement

Answer

Just call this.load(), don’t convert the DOM element into a jQuery element.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement