Hi @escribbles
Thank you very much for using our plugin, could you please give me more details, which variable are you referring to?
Best regards.
I am using the following shortcode for my pages [CP_CALCULATED_FIELDS varname=”5″ id=”14″] in this instance the variable would be 5.
On this page https://www.convertwhiz.com/5-fahrenheit-to-celsius/ the starting value for Fahrenheit should be 5, but when Delay JavaScript execution is enabled on WP Rocket it defaults to 0. When I turn that function off the variable works and it shows 5.
Hello @escribbles
Your form is loaded, and its equations are evaluated before “WP Rocket” includes the delayed blocks of code. A possible solution is to evaluate the equations after completing the page load.
Please, insert an “HTML Content” field in the form, and enter the following piece of code as its content:
<script>
jQuery(window).on('load', function(){
EVALEQUATIONS(jQuery('#cp_calculatedfieldsf_pform_1')[0]);
});
</script>
Best regards.
just wondering if there is a specific js file I can exclude from the delay for the variable to show and be used as the initial value
Hello @escribbles
The variables are not loaded from files. Since these variables are generated dynamically, the plugin creates them into inline script blocks, like:
<script>varname=5;</script>
So, an alternative if you don’t want to edit the equation would be to exclude the inline script block with varname from WP Rocket settings.
Best regards.
Thank you so much! I added varname to the exclusions in WP Rocket and that solved the issue.