I have a problem with my site - http://toppages.co.uk ( built with CakePHP framework) I want to load the javascript after page loading is finished ( Google PageSpeed Insights suggestion), so i moved the entire JavaScript to the footer. Then, after making some tests, i found that JavaScript dones't work properly when is placed to the footer - it loads some times,but some times not.
I tried all possible solutions - first with:
document.onload = function..
,then tried: <body onload="script();">
,after that tried to load javascript asynchronously with "async"
function - notging helps.
So far i can't find a way to make it work. Do you have an idea what couse the problem and how can i fix it ?