function Init(){
   alert(testA());
}function testA(){
   //testB();   能不能像C#那样获取
}function testB(){
   return "hello";
}

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
    <head><title>onresize test</title>
    </head><body onload='Init()'><script type="text/javascript">    function Init() {
            alert(testA());
            
        }    function testA() {
            var a = testB();
            return a;
           
        }    function testB() {
            return "hello";
        }
    </script>
    </body>
    </html>
      

  2.   

    <script type="text/javascript">
    function Init(){
      alert(testA());
    }function testA(){
      return testB(); 
    }function testB(){
      return "hello";

    Init();
    </script>
      

  3.   

    function Init(){
      alert(testA());
    }function testA(){
      return testB(); 能不能像C#那样获取
    }function testB(){
      return "hello";
    }调用Init()会弹出"hello";
      

  4.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
    <head><title>onresize test</title>
    </head><body onload='Init()'><script type="text/javascript">    function Init() {
    testA();
    alert(1);
            alert(testA().testb);
    alert(2);
            
        }    function testA() {
            return {
    testb:testB(),
    testc:testC()
    };
           
        }    function testB() {
            return "hello";
        }  function testC() {
            return "hello-C";
        }
    </script>
    </body>
    </html>
    可以作为一个对象返回 然后通过对象取得值
      

  5.   

    貌似感觉楼主写的不对哦!
    function Init(){
      //这样应该会弹出一个空
      alert(testA());
    }function testA(){
      //在这里调用只会得到一个字符串,并没有做处理。其实这个方法什么也没做
      testB(); 
    }
    //这个方法返回一个字符串“hello”
    function testB(){
      return "hello";
    } function testA(){
      //个人感觉应该这样写
      return testB(); 
    }
      

  6.   

    function Init(){
      alert(testA());
      
    }function testA(){
      //testB(); 能不能像C#那样获取
      //不行像C#。。
      return testB();
    }function testB(){
      return "hello";

      

  7.   

    function testA(){
       return testB();
    }