In my script.js I have this:
$(function () {
function addColors(basicColors) {
...
}
});
And in HTML:
<head>
<script src="scripts/script.js"></script>
</head>
<body>
...
<script>
...
addColors(basicColors);
</script>
...
But in console i am getting
Uncaught ReferenceError: addColors is not defined
The script file is correctly referenced as other functionality defined in that file is working just fine.