为什么javascript不能生成函数的输出?为什么JavaScript不能生成函数的输出?
var name = prompt("What is your name?");
var weight = prompt("what is your weight?");
function check(name ,weight){
if (weight> 25) {
alert (name + "Your weight is " + weight + "which is not normal."+ "Sorry");
}
else {
alert (name + "Your weight is " + weight + "which is normal." + "Welcome");
}
return check;
}check;
</script>
1.因为你有一个语法错误调用它。 2.因为你没有调用你定义的函数。 – icktoofay 2014-11-24 06:50:53
你似乎不打电话检查。你的功能还没关闭 – 2014-11-24 06:50:55
请再检查一次,编辑 – Rumana 2014-11-24 06:54:13