js 如何获取方法的返回值!!!! function Init(){ alert(testA());}function testA(){ //testB(); 能不能像C#那样获取}function testB(){ return "hello";} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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> <script type="text/javascript">function Init(){ alert(testA());}function testA(){ return testB(); }function testB(){ return "hello";} Init();</script> function Init(){ alert(testA());}function testA(){ return testB(); 能不能像C#那样获取}function testB(){ return "hello";}调用Init()会弹出"hello"; <!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>可以作为一个对象返回 然后通过对象取得值 貌似感觉楼主写的不对哦!function Init(){ //这样应该会弹出一个空 alert(testA());}function testA(){ //在这里调用只会得到一个字符串,并没有做处理。其实这个方法什么也没做 testB(); }//这个方法返回一个字符串“hello”function testB(){ return "hello";} function testA(){ //个人感觉应该这样写 return testB(); } function Init(){ alert(testA()); }function testA(){ //testB(); 能不能像C#那样获取 //不行像C#。。 return testB();}function testB(){ return "hello";} function testA(){ return testB();} 如何在子页面中为父页面动态增加控件 看一段正则的意思 麻烦哪位大虾解释下这段js是什么意思? 大家請進!!大家請進!!大家請進!!大家請進!!大家請進!! 正则表达式判断是否为double型,且不能为0?在线等,马上结帖!!! javascript中如何判断子字符串?在线等,急!!!!! 我写一个考试倒计时的JS函数。。。哪位高手能给代码。。。谢拉 一个难题 IE5不支持Array的toString()方法吗? 怎么在FORM在用一个元素选择提交的程序(即ACTION=http://***.cgi那个东西)? 求个图片自动切换JS代码 请教一个js版本google地图的缩放级别的问题
<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();
}