toddmotto/fluidvids

Code doesnt work

akkara opened this issue · 3 comments

Fluidvids.js doesnt work because it is not controling window.load state:

window.onload = function() {
    var iframes = document.getElementsByTagName('iframe');
    // other stuff..
}

This will work.

Or users have to put it before closing body element.

Here you can see an issue that very similar:
http://stackoverflow.com/questions/7549290/dom-getelementsbytagname-problem

This isn't an issue, this is how JavaScript works. Call it DOM ready or before closing body. Your scripts should be at the bottom anyway.

It was an issue, or not. There should be an warning about that. Time wasted to make it work.

Why would there be a warning? Any developer should know it needs to be loaded on DOM ready or before the closing </body> tag. This is one of the most common things that can easily be worked out, just like you have above. The download also comes with the script file at the bottom for anyone to show how it helps :) thanks for posting.