How to ensure my self executing block is executed and ready for use in javascript -


i have 2 script files

file1.js

var module = com.utils.createnamespace('com.pdp.ordermysampletemplate'); (function(ordermysampletemplate) {     ..... })(module); 

file2.js

var module = com.utils.createnamespace('com.pdp.ordermysample'); (function($,m,ordermysample,ordermysampletemplate) {     ...... })(jquery,mustache,module,com.pdp.ordermysampletemplate); 

and in jsp make call init method defined in file2

<script>     $(document).ready( function() { com.pdp.ordermysample.init(); } ); </script> 

i js error saying variables com.pdp.ordermysample not defined. both file1,file2 , jsp invokes them downloaded ajax response question here how can ensure js files downloaded , self executing blocks executed can make use of variables invoke function inside it


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -