이것은 내 코드 조각이며 예상대로 작동하지 않습니다. 내가 잘못JavaScript 호출 함수가 작동하지 않습니다.
<html>
<body>
<form>
<input type="submit" value="Check" onclick="f(x, y, z)"/>
</form>
</body>
<script type="text/javascript">
var x = prompt("Enter the number","");
var y = prompt("Enter the number","");
var z = prompt("Enter the number","");
function f(x, y, z)
{
// first, check that the right # of arguments were passed.
if (f.arguments.length != 3) {
alert("function f called with " + f.arguments.length +
"arguments, but it expects 3 arguments.");
return null;
}
}
</script>
</html>
미래에는 문제가 무엇인지 말해야합니다. 당신은 무엇을 기대했으며 무슨 일이 일어나고 있는지. –
안녕하세요, 첫 번째로, 전달 된 인수가 3 개의 인수와 일치하는지 확인하고 있습니다. 하지만, 여전히 작동하지 않습니다 .. 어떤 생각? – Sakthivel