javascript - Can HTML <script> tags connect from different points? -


as making text rpg, wondering if make javascript in tags but, in weird order, this:

<!doctype html> <html> <head> </head> <body>    <script>     ex();  // call function here   </script>    <script>     function ex() {       alert('test'); // make function here     };   </script> </body> </html> 

no, variable/function has defined before call it

uncaught referenceerror: ex not defined 

clarification

you can put scripts wherever please , variables/functions shared, have in correct order


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -