What is the best way to create a global object? If a variable is created in the object for which a loaded DOM is needed. If a DOM loaded is not needed, then you can
photoFunc = { obj_size: 'eclipse' }
And if you need something like that?
document.addEventListener('DOMContentLoaded', function(){ photoEl() }, false); function photoEl(){ return photoFunc = { obj_size: document.getElementById('eclipse') } }