External Javascript file not working

javascript

#1

Connected script (javascript) is not working.
The path is correct.
The script is correct.
What’s the matter?
alert ('hello')


#2

Can you please attach a screenshot or a code snippet of the script you’re referencing and a screenshot of the the page running with the browser console open so you can see the errors?


#3


#4


#5

When I write the same script in the console browser - it works.


#6

For the answer to this, please see this thread: Mixed content errors


#7

How I can correct ? I dont understand


#8

It’s not helps me. What I can do?


#9

Hi,

The file listed in your last screenshot would be run on the browser. Currently trying to run it won’t work as Node doesn’t have a $document variable.

In the file, you’re using $document.ready, but I’m not sure if you have created $document yet. Maybe you wanted to write $(document).ready instead? Also, if this is the case, run the app again, and check the console for other errors.

Regards,
​Mutahhir