Hi I'm using Eclispse for a small project and trying out Jquery for
the first time. I have downloaded the jquery-1.3.2.min.js file and
reference it as i should in my page, However the script does not seem
to work and I get a firebug error '$ is not defined'. The
jquery-1.3.2.min.js file is in the same directory as as my webpage.
This is the following code I'm trying to run.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<style type="text/css">
        #box
        {
                background:red;
                width:80px;
                height:80px;
        }
</style>

<script type="text/javascript">
        $(document).ready(function(){
                $('a').click(function() {
                        $('#box').fadeOut();
                });
        });

</script>

<title>Test</title>
</head>
<body>
        <div id="box"></div>
        <a href="#">Link</a>

</body>
</html>

Can someone please help.

Reply via email to