javascript in dreamweaver

Status
Niet open voor verdere reacties.

jeroenswebpage

Gebruiker
Lid geworden
9 mei 2010
Berichten
56
u ziet dat ik hier een script wil aanroepen

een doodgewone klok om te leren hoe het moet in dreamweaver
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
<!--
body,td,th {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 18px;
background-color: #003;
letter-spacing: normal;
text-align: left;
vertical-align: sub;
white-space: pre;
color: #09C;
}
a {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
color: #0C0;
}
a:visited {
color: #9C0;
}
a:hover {
color: #F00;
}
a:active {
color: #FF0;
}
-->
</style></head>

<body>
<SCRIPT LANGUAGE="JavaScript">
<!--
function ticker()
{
setTimeout("document.ticker.ticker.value = ('Welkom.')",0)
setTimeout("document.ticker.ticker.value = ('Op de javascript pagina.')",2500)
setTimeout("document.ticker.ticker.value = ('Van dreamweaver.')",5000)
setTimeout("ticker()",7500)
}
ticker()
// -->
</SCRIPT>

<FORM NAME="ticker">
<INPUT TYPE="TEXT" NAME="ticker" SIZE="40"style="border: solid #FFFFFF;background:#6699FF; border-width: 2px;">
</FORM>

<script src="klok.js"type="text/javascript"language="javascript"></script>

</body>
</html>


Dat bestand is opgeslagen als .js

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Abraham I. (abraham_824@hotmail.com) -->
<!-- Begin
function clock() {
var t = new Date();
var h = t.getHours();
var m = t.getMinutes();
var s = t.getSeconds();
var units = new String("");
var hours = t.getHours();
var min = t.getMinutes();
var sec = t.getSeconds();
document.clock.hours.value = units.substring(0, hours);
document.clock.minutes.value = units.substring(0, min);
document.clock.seconds.value = units.substring(0, sec);
var status = "AM";
if (hours > 11)
status = "PM";
if (hours < 11)
hours -= 12;
if (min < 10)
min = "0" + min;
if (sec < 10)
sec = "0" + sec;
document.clock.h.value = hours;
document.clock.m.value = min;
document.clock.s.value = sec;
document.clock.time.value = hours + ":" + min + ":" + sec + " " + status;
window.setTimeout("clock()", 900);
}
// End -->
</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascript pagina klok</title>
</head>

<body onLoad="clock();">>
<form name="clock">
<table>
<tr>
<td>
Hours:
</td>
<td>
<input type="text" name="h" size="10" style="border: 0">
</td>
</tr>
<tr>
<td colspan=2>
<input type=text name="hours" size="24" style="color: navy">
</td>
</tr>
<tr>
<td>
Minutes:
</td>
<td>
<input type="text" name="m" size="10" style="border: 0">
</td>
</tr>
<tr>
<td colspan=2>
<input type=text name="minutes" size="60" style="color: navy">
</td>
</tr>
<tr>
<td>
Seconds:
</td>
<td>
<input type="text" name="s" size="10" style="border: 0">
</td>
</tr>
<tr>
<td colspan=2>
<input type=text name="seconds" size="69" style="color: navy">
</td>
</tr>
<tr>
<td>
Time: <input type=text name="time" size="20" style="border: 0">
</td>
</tr>
</table>
</form>

</body>
</html>


Nou nu zegd dreamweaver

There is a syntax error on line 34

Nou al sla je me dood, dat is het einde van het script </script>

Wie kan mij helpen
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan