now as far as the error is concerned: AO never stores files directly in the cache directory, but aggregates the files and saves them as “autoptimize_xyz.js or autoptimize_123.css”. this means that the files are being loaded by some javascript in a manner that assumes those files (shim.css and form-core.js) are in the same directory. as that js itself is optimized, the 2 files are not in the same location any more and you get those 404’s.
after some looking around it seems it is caldera forms doing this, and more specifically caldera-forms/assets/js/polyfiller.min.js. try excluding that from JS optimization first, but chances are you’ll have to exclude /caldera-forms/ entirely and maybe jquery.js as well.
oh and do disable comet cache’s JS and CSS optimization first when using AO, using two minifiers at the same time is asking for trouble π
hope this helps,
frank
Hi Frank –
Thanks for the quick (and thorough) response. Excluding polyfiller.min.js did the trick!
Leaving a great review now π
Best,
Pete
hi, i am having the same problem.
Excluding the polyfiller helped with the majority of forms, but one is still not working and i don’t know why.
Please help?
Link to page: http://mojzastopnik.si/zavarovanja/zivljenjsko-zavarovanje/osebni-konfigurator/
The button isn’t working so nobody can enter the form, the background image should be full screen and with an overlay…
this is a difficult one; you have a script template;
<script type="text/html" id="conditional-fld_6764803_1-tmpl">
<div class=""><!DOCTYPE html>
<html>
<head>
<title>Font Awesome Icons</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
</head>
<body>
<center><i class="fa fa-exclamation-circle" aria-hidden="true" style="font-size:180px;color:red;"></i>
</body>
</html></div></script>
as that template has a </body> tag, AO incorrectly injects the autoptimized JS at that place, rendering it useless (and probably killing the template as well).
try this code to force AO to inject the JS elsewhere;
add_filter('autoptimize_filter_js_replacetag','oga_js_replacetag',10,1);
function oga_js_replacetag($replacetag) {
return array("</footer>","after");
}
hope this helps,
frank
hi!
thanks for the supersonic reply!
yes, it is the body tag that is causing the problem. i removed it and is working.
But… since the exclamation point is kind of essential for the form,please provide me some guidens where to put that code π
Thank you.
you can use the code snippets plugin to add the … code snippet I provided π
correction…the bacground image is showing as it supposed to, but the button isn’t working when the <body> tag removed…
any ideas?
thanks
so the functions.php it is π
i have to many plugins already so i just put the code in my child theme functions.php.
But…the button is still not working so it should be something more that is bothering my form.
What about the excludes js’s?
i was experimenting and added all of these:
caldera-forms/assets/js/handlebars.baldrick.js, caldera-forms/assets/js/handlebars.js, caldera-forms/assets/js/polyfiller.min.js, caldera-forms/assets/js/modals.baldrick.js, caldera-forms/assets/js/jquery.form-validator.min.js, caldera-forms/assets/js/jquery.form-validator.js, caldera-forms/assets/js/caldera-modals.min.js, caldera-forms/assets/js/caldera-modals.js, caldera-forms/assets/js/frontend-script-init.min.js, caldera-forms/assets/js/frontend-script-init.js, caldera-forms/assets/js/html5.js, caldera-forms/assets/js/ajax-core.min.js, caldera-forms/assets/js/ajax-core.js
π
i guess that is not right either… π
thank you for your help.
well, you could try removing all excludes (except if you’re sure you need them) OR add js/jquery/jquery.js to the list (as you have “ReferenceError: jQuery is not defined”)
frank
well, i’m not sure of everything since i don’t know anything about this, really π
but – i added js/jquery/jquery.js and everything is fine now!!!
thank you thank you thank you thank you thank you !!!!