For some reason I can’t combine my javascript files in one single file through php, like I can with css.
Basicly I wish to combine all of my javascript files into one. However that breaks my code somehow. It’s like the $-value which jQuery generates isn’t available through the rest of the code (such as jquery ui).
Does the jQuery need to be loaded in it’s own <script type="text/javascript" src=""></script> for some reason? And what is that reason then?
I include them in the same order that they work in the browser.
jQuery -> jQuery UI -> jQuery custom functions -> my own script
You might want to put a new-line and/or semicolon between the single scripts.
E.g. the minified jquery ui script you get from https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js ends with
If you now append another script right behind that you will most likely get a syntax error.
Lets take a crude scripts.php
this won’t work, but
will.
Other things to consider: