function Init(){
alert(testA());
}function testA(){
//testB(); 能不能像C#那样获取
}function testB(){
return "hello";
}
alert(testA());
}function testA(){
//testB(); 能不能像C#那样获取
}function testB(){
return "hello";
}
调试欢乐多
<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>
function Init(){
alert(testA());
}function testA(){
return testB();
}function testB(){
return "hello";
}
Init();
</script>
alert(testA());
}function testA(){
return testB(); 能不能像C#那样获取
}function testB(){
return "hello";
}调用Init()会弹出"hello";
<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>
可以作为一个对象返回 然后通过对象取得值
function Init(){
//这样应该会弹出一个空
alert(testA());
}function testA(){
//在这里调用只会得到一个字符串,并没有做处理。其实这个方法什么也没做
testB();
}
//这个方法返回一个字符串“hello”
function testB(){
return "hello";
} function testA(){
//个人感觉应该这样写
return testB();
}
alert(testA());
}function testA(){
//testB(); 能不能像C#那样获取
//不行像C#。。
return testB();
}function testB(){
return "hello";
}
return testB();
}