爲什麼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