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
Post a Comment