Have problem with jQuery

jquery

#1

Hey! I want to install jquery pack on my PC to continue and develop offline.I've download jquery file from official site, wrote in html script src and jquery code in body, but it doesn't work. Then I wrote link to the web-version of jquery, but it's the same problem. Really don't know why, and what is the cause, because I was making it like it 2-3 videoo tutorials. Here is my code.

<!DOCTYPE html>
	<html>
		<head>
				<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
		</head>
		<body>
			<script type="text/javascript">
			$(function() {
				alert("Hurrray!");
			};);
			</script>
		</body>
	</html>

#2

Perhaps this topic will help you.


#3

Thanks a lot. I was trying it before, but I hadn't success. It works. But where is the problem with my code?


#4

The problem is with your syntax.

If you want to use jQuery try to use $(document).ready() like this:

$(document).ready(function(){
    alert("Hurrray!");
});

If you want to use pure JavaScript write it with self-Invoking anonymous function:

(function(){
    alert("Hurrray!");
})();