Select Appearance -> Add a new script. Give the file a name and just add the content.
head tag or before the closing
There's nothing special here but you're probably wondering how you get the full url to your script. Here's what your
script tag should look like in Innota if your filename is
This will be rendered as something like this
1455627260 in the filename is sort of a version number of the file. It's based on the last time the file was modified, and you really don't have to worry about it.
You can read more about caching in Innota in our blog.
You're probably used to split all your scripts into more than one file. This is the recommended practice in Innota as well.
The problem in using multiple files is that your html traditionally looks something like this
This is bad for performance. The browser needs to make three requests to load all these files and there's always some overhead in making an HTTP request. This is where concatenating comes into the picture.
Here's how you would make the above example in Innota
That's it. When you publish your site, the above tag will look something like this
js_compiled() tells Innota to create a concatenated version of all of your scripts and give the full url to that file.
The files are concatenated in alphabetical order. Best practice is to use a number in front of the file to make the ordering easier. You could name the files something like this:
To make your site as fast as possible you should always try to use
To make the scripts as small as possible
js_compiled() also automatically minifies the contents.
Minification is a simple process of removing all the things from the file that the browser doesn't need. For instance, all comments and empty spaces are removed. This makes the file smaller without sacrificing anything, and everyone saves precious bandwidth.