jQueryを利用しない実装方法はこちらの記事を参照してください。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript" src="jquery-2.0.3.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
alert("Helo jQuery World!");
})
</script>
テストページ
</body>
</html>
$(document).ready(function () {
(実行するjavascript....)
})
と記述するとページ表示時にブロック内のjavascriptを実行できます。<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript" src="jquery-2.0.3.js"></script>
</head>
<body>
<script type="text/javascript">
$(window).load(function(){
alert("Helo jQuery World!");
})
</script>
テストページ
</body>
</html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript" src="jquery-2.0.3.js"></script>
</head>
<body>
<script type="text/javascript">
$(window).on('load',function(){
alert("Helo jQuery World!");
})
</script>
テストページ
</body>
</html>