Fixed :)
Changes may look like:
- set obj.defineProperty to "loading"
- Override event listerner
- Load script
- execute all the overridden events
문제
I am facing issue with document.ready code due to async loading. For async loading I am using control.js http://stevesouders.com/controljs/
My js file, custom.js, is having code like:
jQuery(function(){
jQuery('#keyword').autocomplete();
});
And my js file sequence is as below:
<script src="control.js" type="text/javascript"></script>
<script type="text/cjs" data-cjssrc="jquery-1.7.1.min.js"></script>
<script type="text/cjs" data-cjssrc="custom.js"></script>
<script type="text/cjs" data-cjssrc="jquery.autocomplete.min.js"></script>
So, due to file sequence, code is generating error. I don't want to change file sequence. Is there any way to fix this issue without changing file sequence?
What I was thinking is to use try-catch.
Another thing I had in my mind to bind all the ready events, and execute it later once all scripts are loaded. But didn't find any robust solution.
Please let me know if you have any tips n tricks.
해결책
Fixed :)
Changes may look like: