עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[עזרה] למה כותב לי UNDIFINED בסוף (html+js)?

Featured Replies

פורסם


<html>
<head>
<title>
JavaScript no. #4
</title>
<script language = "javascript">
var k=20;
function countDown()
{
for (var k=20; k>=1; k--)
{
document.write(k*1+"  ");
}
}
</script>
</head>

<body bgcolor = "#3D3D3D" text = "#D3D3D3" link="#D3D3D3" alink="#FFFFFF" vlink="#D3D3D3">
<font size = "4">
<center>
<br />
<h4>What's that up in the sky? it's a bird, it's a plane... no - it's</h4>
<h1>JAVASCRIPT World!</h1>
<table border="0" align="center" cellspacing="3">

<tr>
<td bgcolor="#FFFFFF" align="center" height="40" width="570"><font size="4" color="#3D3D3D"><b>

<script language = "javascript">
document.write(countDown());
</script>

</b></font></td>

</tr>
</table>
<br /><br />
Using "for" comand in a table with number printing.
<br /><br /><br /><br />
<a href="EX4-4.html" onmouseover="window.status='To The Next Page!'; return true;" onmouseout="window.status=' '">Next</a>
</font>
</center>
</body>
</html>

משום מה הוא כותב לי בסוף התוכנית UNDIFINED....

למה? אין לי שממץ ועזרה תתקבל בשמחה ;D

תודה מראש :jump:

פורסם

תוסיף בבקשה לכותרת את השפה בה אתה כותב (html).

ולגבי השאלה שלך - הפונקציה countDown לא מחזירה שום ערך, אלא רק מדפיסה. אתה לא צריך לקרוא לה באמצעות document.write.

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.