Calling a function that's defined inside a function

后端 未结 3 647
盖世英雄少女心
盖世英雄少女心 2020-12-16 02:26

*Is there a way to call a function defined inside another function in javaSCRIPT? For example:

window.onload() = function() {
    function my_function(){
            


        
3条回答
  •  时光说笑
    2020-12-16 02:52

    window.onload = function() {
        my_function()
    };
    
    function my_function(){
        alert("Blah");
    };
    
    function function_two(){
        my_function();
    };
    

提交回复
热议问题