Ask HN: Include JavaScript via PHP or HTML?

https://news.ycombinator.com/item?id=1182910
by clusterfu_k • 16 years ago
3 1 16 years ago

So in my regular website building duties I have noticed that including the text of my javascript file renders the page faster than if the javascript file was merely include via html.

(In PHP)

<script type="text/javascript" src="stuff.js"></script>

v.s.

<script type="text/javascript"><?php require_once("stuff.js");?></script>

Is there any downside to me including the file via php?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com