Here is my glitch code for silly story generator.
In the Preview window, the button does not work when clicked. Under inspect console, it shows:
Uncaught TypeError: randomize is null
<anonymous> https://marmalade-quilted-cardigan.glitch.me/main.js:15
main.js:15:1
<anonymous> https://marmalade-quilted-cardigan.glitch.me/main.js:15
The instructions does not seem to require me to modify randomize
, so I would really appreciate if someone can tell me why this happens. Thanks in advance!
I just solved the problem (by peaking the source code)…I would leave the post in case others facing the same problem.
Just follow the Basic setup in the first place!
- Apply the external JavaScript file to your HTML by inserting a
<script>
element into your HTML referencing main.js
. Put it just before the closing </body>
tag.
This setup makes so much sense after having this error.
1 Like
Hello @chanyayun
you could use the defer attribute also if you are interested
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
and have a nice day 
1 Like