Martin Phee:
Interesting. I changed both and now it loads. Why?
If I create another portlet that needs these files will it break again?
Hi Matin,
In order to answer of you Question :
All js files are depends of master js file (i.e. jquery-1.5.1.min.js) ignore version in this case.
Now lets take a example you are using js1 which is your own portlet js file.
Now at the time of loading when some function make use of js1 file and your master js file is not loaded yet then it will not able to run.
And your function will not work and it seems that js1 file is not loaded.
In this case you need to make sure that your Master js file should load first before any js load or use.
So, Generally we recommend keep your master js file on theme so it will load very first before any other js are loaded.
Now in your case even if you kept your js file into footer it was not working , and when you kept in header its work as you expected.
Reason could be like your are using some function which are try to access this js file which is not loaded yet cause it is at footer.
so when you keep it at header it will be available early at you page but it will increase load on page.
Conclusion "You should keep your own porlet js at footer but make sure some function will use that js after js loaded and Master js file should be loaded on early base"
Thanks,
Sagar Vyas
Please sign in to flag this as inappropriate.