JavaScript DHTML/HTML/Body — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 10:02, 26 мая 2010
Содержание
Body on click event
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
function yourMessage()
{
alert("Your first function!");
}
</script>
</head>
<body onClick="yourMessage()">
</body>
</html>
Body onload event
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
function yourMessage()
{
alert("Your first function!");
}
</script>
</head>
<body onLoad="yourMessage()">
</body>
</html>
Body on stop event
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
function stopped()
{
alert("don"t go");
}
</script>
</head>
<body onstop="stopped()">
</body>
</html>
Running a Script from the body onload Event Handler
<html>
<head>
<title>An onload script</title>
<script type="text/javascript">
function done() {
alert("The page has finished loading.");
}
</script>
</head>
<body onload="done()">
Here is some body text.
</body>
</html>