I've tried to load an external javascript (chat app) to my webpage by using below following code and its always giving ReferenceError: $ is not defined while my script and URL to the script is ok.
<script>
$(document).ready(function() {
$("#customer-chat-button-toggle").click(function() {
$.getScript('livechat/php/app.php/widget-init.js',function(){
async: false;
})
});
});
</script>