This is actually a good question: there's a <script> tag in main.html, but the script is not actually executed. It turns out the HTML specification says that scripts inserted as HTML strings are not executed. (I'm not sure why - scripts in attributes like 'onclick' can still run, so this rule doesn't completely block JS execution.)
It seems that in Construct it would be useful to allow such scripts to run, so projects like yours work as expected. The limitation can be worked around to force inserted scripts to run, and I've done that for the next beta, which fixes your example.