This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Can anyone tell me why adding window.onload = function(){ app.core.main();}
to the html served by my application will cause it to get an error similar to this: https://www.refheap.com/107001 , but calling the main method inside the actual cljs file will initialize everything properly? Here's a stripped down version of the cljs: https://www.refheap.com/107002 (only 16 lines)
@lucien.knechtli: maybe due to the <div id=“app”> element is not ready on window.onload
Isn't window. onload supposed to fire after all the assets have been downloaded? Doing a timeout seems like a really hacky workaround ...
or are you saying do the timeout as a test to make sure it isn't timing related
ok tried the timeout and I'm still getting the error..
Also tried using the DOMContentLoaded event, I guess something about calling it as app.core.main() is creating the issue. weird
@lucien.knechtli: hard to tell, but the error seems to indicate that (.getElementById js/document "app")
is failing to return a DOM element.
For us to help you further, you have to come up with a minimal, complete example. Gist? repo?