Uncaught ReferenceError: $ is not defined [closed]

2

Where did I go wrong?          form test            

<script type="text/javascript" >
    $(document).ready(function(){
        $('#meuForm').validate({
            rules:{
                nome:{
                required: true
                },
                email:{
                    required: true
                },
                telefonefixo:{
                    required: true
                },
                celular:{
                    required: true
                }
            },
            messages:{
            nome:{
                required: "O campo é obrigatorio."
                },
                email:{
                    required: "O campo é obrigatorio."
                },
                telefonefixo:{
                    required: "O campo é obrigatorio."
                },
                celular:{
                    required: "O campo é obrigatorio."
                }
            }

        });
    });
</script>

</head>
<body>
<form name="meuForm" action="" method="POST">
NOME:<br>
<input type="text" name="nome" /><br>
Email:<br>
<input type="text" name="email" /><br>
telefone fixo:<br>
<input type="text" name="telefonefixo" /><br>
Celular:<br>
<input type="text" name="celular" /><br>
<input type="submit" name="Cadastrar" />
</form>

</body>
</html>

I used it in the header

 <script type="text/javascript" href="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js" > </script>
<script type="text/javascript" href="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js" > </script>
    
asked by anonymous 04.03.2015 / 17:04

1 answer

8

Your syntax for adding scripts is wrong.

There is no attribute href for the script tag, but src .

Replace the inclusions with:

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script><scripttype="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>

Anyquestions,seethew3smanual: link

    
04.03.2015 / 17:15