I have one script inside an HTML file. I want to make it as an external script bec I need it in more than one files.
When I move it to an external file, it started showing errors, some probably need an import of another js library that was included in html.
Here is a minimal script with errors line, where it is raising. How doe remove these.
RE-EDIT
The errors I put, these are shown by Brackets ide when I save the script file. In HTML, it is rendering the chart. There was a typo in path, that I corrected. Though the errors in the brackets ide are same still.
Errors;
'document' is not defined
myChart is defined but never used // I called script in html
'Chart' is not defined
External JS:
function loadChart (var)
{
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
.
.
.
.
.
}