How can I access an object that was initialized in my HTML document?
This is what my HTML document looks like:
...
<script type="text/javascript" id="controller">var controller = false;</script>
...
<body onload="controller = new CTRLclass()">
....
What is the best way to call controller.doAMethod() in an external JavaScript file using DOM operations or similar techniques?
Edit: Hey everyone, I have multiple .js files and my controller creates an instance of another class in its constructor. In this newly created instance of the class, I need to access the controller in order to call an update function. For example: The controller creates an instance of a class and the class needs to call controller.update(). How do I access the controller in the 'class' - That's all!
Thank you!