inlined javascript

Inline small javascript files

In-lining JS simply means putting your javascript into your HTML file instead of an external JS file. The benefit this provides is the reduction of files the browser has to download prior to displaying your web page.

How to inline JS

Basically you just copy the contents of your external JS file and paste them between script tags into your HTML.

It looks like this:

<script type="text/javascript">
YOUR JAVASCRIPT HERE
</script>

What does this do?

Putting your JS into your HTML will save the web browser a round trip to the server, since you are no longer asking for a seperate external file for the browser to load to see and execute your JS.

by Patrick Sexton