0
Included a . js file in an MVC project. my . js file looks like this:
$(document).ready(function() {
function escondePanel(painel) {
$("#pnPessoal").css("display", "none");
$("#pnContato").css("display", "none");
$("#pnDocumento").css("display", "none");
$("#pnOutro").css("display", "none");
$(painel).css("display", "block");
}
$("#pessoal").on("click", function () {
escondePanel("#pnPessoal");
});
$("#contato").on("click", function () {
escondePanel("#pnContato");
});
$("#documento").on("click", function () {
escondePanel("#pnDocumento");
});
$("#outro").on("click", function () {
escondePanel("#pnOutro");
});
});
Include the file . js in Mmnha view like this:
@Scripts.Render("~/Scripts/code-servidor.js")
However the code is not working and I’m getting the error on the console:
Referenceerror: $ is not defined - line 1.1
What’s wrong? Because I copied the structure of another file of mine that works normally.