612
צפיות
צפיות
5
תשובות
תשובות
מה לא בסדר בקוד (js)
מה לא בסדר בקוד הבא:
<html>
<head>
<title>do loop</title>
</head>
<body>
<script language="javascript">
var requested_month=0;
var montharray=
[
"",
"junary",
"febuary",
"march",
"april",
"may",
"juane",
"jualy",
"agust",
"september",
"octuber",
"november",
"december"
]
document.write("enter a a number between 1 and 12, and i tell you the name of the month.<br>");
do
{
requested_month=prompt("enter a number between 1 and 12 (or 0 to exit)", 0);
document.write(montharry[requested_month] + "<br>");
} while (requested_month != "0")
</script>
</body>
</html>
מי שלא הבין ניסתי לבנות פה סקריפט שכל מספר שכניסו יתן תשם של החודש אבל זה לא פועל מישהו יכול לעזור???
5 תשובות
ישר קוד לשמאל
ישרתי לשמאל יש מישהו שיכול לעזור
<html>
<head>
<title>do loop</title>
</head>
<body>
<script language="javascript">
var requested_month=0;
var montharray=
[
"",
"junary",
"febuary",
"march",
"april",
"may",
"juane",
"jualy",
"agust",
"september",
"octuber",
"november",
"december"
]
document.write("enter a a number between 1 and 12, and i tell you the name of the month.<br>");
do
{
requested_month=prompt("enter a number between 1 and 12 (or 0 to exit)", 0);
document.write(montharry[requested_month] + "<br>");
} while (requested_month != "0")
</script>
</body>
</html>
הנה
var requested_month=0;
var montharray=
[
"",
"junary",
"febuary",
"march",
"april",
"may",
"juane",
"jualy",
"agust",
"september",
"octuber",
"november",
"december"
]
document.write("enter a a number between 1 and 12, and i tell you the name of the month.<br>");
do
{
requested_month=prompt("enter a number between 1 and 12 (or 0 to exit)", 0);
document.write(montharray[1*requested_month] + "<br>");
} while (requested_month != "0")
מישהו יכול לעזור זה דחוף בוקשה
בוקשה עזרה אני חייב את זה לעבודה אני יודה מאוד למי שיעזור!!
בהצלחה
<script type="text/javascript">
Date.prototype.getMonthName = function(){
var monthNames = [
"January",
"February",
"March",
"April",
"May",
"june",
"july",
"August ",
"september",
"October",
"november",
"december"];
return monthNames[this.getMonth()];
}
var month=1, d = new Date(2005,month-1,01,00,00,00);
onload = function(){
document.body.innerText = document.body.textContent = d.getMonthName();
}
</script>
ודחוף תכתבי על דלתות