Skip to content
Advertisement

Why does my simple script tag break the following script tag? [closed]

I am tearing my hair out over this. Why is foo() undefined when I click the button in this script?

JavaScript

but not if I remove the first script tag?

JavaScript

My app2.js is just

JavaScript

I have tested in Chrome and Safari on macOS. The hello function works as expected.

Advertisement

Answer

Auto closing tags are used in React JSX and not in vanilla HTML Replace

JavaScript

with

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement