I am just a new Javascript fan, so when I read the Javascript document, there are a lot of complex structures that I cannot execute.
Here is a brief description of the Javascript code I'm reading: in my case, there are two main files: Helper.js and Circle.js .
There is a method name in Helper.js: using:function(param1,param2) . Below is the code for Circle.js :
Helper.using('py.Figures', function (ns) { ns.Circle = function (params) {
And in the test.html file, I write code like this:
<script src="Helper.js"></script> <script src="circle.js"></script> <script> test = function(){ py.Figures.Alert(); </script> <body onload="test();"></body>
When I launch Chrome and view the console, I encounter this error:
Uncaught TypeError: Object # does not have a 'Alert' method
This means that I have not imported this class yet. Tell me how to call a function from another file. In my case, this is: Alert() call
Thanks:)
@ Edit: I added some links for the code:
Helper.js
Circle.js
hqt
source share