Fixed It.
(by trial and error)
Upon going to the console I got the $ is not defined error. Googled around and you had to get the jQuery javascript code by running it inside a code block. (Source: https://stackoverflow.com/questions/2194992/jquery-is-not-defined)
Example:
$(document).ready(function () {
//your code here
});
So my code became
<script>
$(document).ready(function ()
{
$('textarea').emoji({place: 'after'});
}
);
</script>
INSTEAD OF
<script>
$(function () {
$('textarea').emoji({place: 'after'});
})
</script>
Problem Was
I'm looking at running the following script within the post.html file of the throat/app/html/sub folder so that it picks up an emoji picker and places it below the post comment form. Here's what I'm trying to achieve.
It seems to work locally but goes kaput on the production site. Local pic.
$(function () {
$('textarea').emoji({place: 'after'});
})
Upon digging, I'm told the $(function) won't work and I need to change the lines but not how. And that's it!
To the post.html, I made changes and added the following declarations(?) instead of adding these with the divs. I just copied the block head and super from another file, thinking it would work :p
{% block head %}
{{ super() }}
<script language="JavaScript" src="https://code.jquery.com/jquery-3.4.1.slim.min.js""></script>
<script src="{{url_for('static', filename='js/inputEmoji.js')}}"></script>
{% endblock %}
The inputEmoji is the main javascript file.
I"ve just given up on how to fix the following i.e. rearranging the script - the $ or function etc. Would be great if any of you could share what changes do I need to make to the following for it to work.
$(function () {
$('textarea').emoji({place: 'after'});
})```
We don't use external javascript or jquery for safety and faster load times. We purposely removed google scripts, font-awesome icons, and captchas. You risk breaking several functions, breaking future compatibility, and allowing an external site to be able to inject code into your site and track your users activity at any time.