Hi. I got the error above. organizatioin/orgcration.js:2: ReferenceError: $ is not defined
. I belive it has to do with jQuery or Bootstrap, as I'm following a tutorial that tells me to install those plugins.
Here's the whole code in orgcreation.js:
$('#orgButton').click(() => {
mp.trigger('orgCreation', $('#orgName').val(), $('#orgAbb').val());
});
It appears not to recognize the '$' symbol. I don't understand why, as I have installed both jQuery and Bootstrap. Here's my 'node_modules' folder:
Any ideas on what might be wrong? The 'organizations' folder looks like this:
And the 'Dependences' folder insite it like this:
The html.html code where the event is triggered has just this code:
<!DOCTYPE html>
<html>
<head><link rel="stylesheet" href="common.css"></head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body>
<div class="org-bar">
<h1 style="font-size:20px;">Criar Organização</h2>
<form id="orgCreation" action="welcome.php" method="post"></form>>
<label for="orgName"></label>
<input class="textInput" type="text" id="orgName" name="orgName" placeholder="Nome da Organização [5-20]" minlength="5" maxlength="20">
<label for="orgAbb"></label>
<input class="textInput" type="text" id="orgAbb" name="orgAbb" placeholder="Abreviatura da Organização [3-4]" minlength="3" maxlength="4">
<input class="button" type="button" id="orgButton" value="Criar">
</div>
</form>
</div>
<script src="orgcreation.js" type="text/javascript"></script>
</body>
</html>
I don't understand what's wrong. Any ideas on why '$' is not recognized?
@EDIT
I changed the <head>
to the below, but it still gives the same error:
<head>
<link rel="stylesheet" href="common.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>