Show
Ignore:
Timestamp:
05/10/08 17:29:47 (7 months ago)
Author:
jburke
Message:

Fixes #6727. Support a djConfig.addOnLoad option. Also updated API docs for djConfig.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/tests/_base/_loader/afterOnLoad.html

    r12492 r13682  
    1010 
    1111                <script type="text/javascript"> 
    12                         window.onload = function(){ 
     12                        function init(){ 
    1313                                //Create global djConfig object first. We cannot use the djConfig attribute 
    1414                                //on the script tag since it may not be visible in some browsers at the time 
     
    2020                                        parseOnLoad: true, 
    2121                                        afterOnLoad:true, 
     22                                        addOnLoad: function(){ 
     23                                                //This function is registered with 
     24                                                //dojo.addOnLoad as Dojo is defined after 
     25                                                //being added to the DOM. 
     26                                                console.log("djConfig.addOnLoad callback fired OK: dojo.parser.parse is a " 
     27                                                        + (typeof dojo.parser.parse)); 
     28                                        }, 
    2229                                        require: [ 
    2330                                                'dojo.parser', 
     
    3744                                console.debug("onChange for id = " + id + ", value: " + newValue); 
    3845                        } 
     46                         
     47                        //Register onload init function that will add Dojo to the page. 
     48                        if(window.addEventListener){ 
     49                                window.addEventListener("load", init, false); 
     50                        }else{ 
     51                                window.attachEvent("onload", init); 
     52                        } 
     53 
    3954                </script> 
    4055        </head>