הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   [JS] עזרה בקוד ספירה פשוט (https://hosts.co.il/forums/showthread.php?t=25499)

l!ornet 02-07-06 19:47

[JS] עזרה בקוד ספירה פשוט
 
קוד:

<html>
<head>
<title>The Year 2000</title>
</head>
<body>
<h1>how many seconds did pass since year 200</h1>
<h4>
<script type="text/javascript">
now=new date("Jul 01 2006 20:16:10");
y2k=new date('Jan 01 200 00:00:00");
seconds= (now-y2k)/1000;
document.write ("Seconds passed since the year 200:"+seconds);
</script>
</body>
</html>

מה הבעיה בקוד הזה ??
לא מצליח להריץ אותו
הכול תקני
לא רואים תחלק של הJS

Elad-A 02-07-06 19:48

אני חושב אתה צריך להכניס את הקוד בין <head> ל </head>

l!ornet 02-07-06 19:55

לא עובד אחי

Elad-A 02-07-06 19:59

קוד:


<html>
<head>
<title>The Year 2000</title>
</head>
<h1>how many seconds did pass since year 200</h1>
<h4>
<script type="text/javascript">
now=new date("Jul 01 2006 20:16:10");
y2k=new date('Jan 01 200 00:00:00");
seconds= (now-y2k)/1000;
document.write ("Seconds passed since the year 200:"+seconds);
</script>
<body>
</body>
</html>

תנסה ככה

l!ornet 02-07-06 20:07

לא

RS324 02-07-06 20:20

תוסיף את המילה VAR לפני seconds,know,y2k
לא בטוח שזה חובה אבל להזיק זה בטוח לא.

miniature 03-07-06 00:42

לפני הכל יש דבר אחד שמציק לי: התגית H4 לא סגורה.


כל הזמנים הם GMT +2. הזמן כעת הוא 05:10.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ