Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I remember feeling utterly lost when my browser barfed because I typed

    <script src=“…”>
without a closing

    </script>
like I would for an <img> tag.


<script> should probably have been superseded by <link> for external files ages ago, then you could have your self-closing tag and <script>var foo=42;</script> would still work too.


I stepped on that beartrap just last week, Chrome at least will swallow the rest of the page looking for the missing </script>. Context: bulk export of thousands of legacy CGI HTML pages using "chrome --headless" to archive to PDF. The cause was a side effect of xmlstarlet which I used to inject links for CSS and JS rendering fix ups for PDF. The result was perfectly rendered 1-page blank PDFs :/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: