I have a follow button that implement ajax but it is returning Uncaught ReferenceError: $ is not defined
so in other words it is not working, here I will leave the code please help.
prifile.html
<a type="button" id="follow" role="button" href="{% url 'follow' post_owner.username %}">Follow</a>
<script type="text/javascript">
$("#follow").click(function(e){
e.preventDefault();
var href = this.href;
$.ajax({
url : href,
success : function(response){
if(response["following"]){
$("#follow").html("Unfollow");
}
else{
$("#follow").html("Follow");
}
}
})
})
</script>