Load the sources as defer
-
Hi, I am the developer of WP Fastest Cache. I want to ask a question. If you answer it, you make me so happy.
I want to load the sources as defer and move the inline js to top of the js sources.
The sources are loaded as on the first example but I want to replace them as on the second example. does it cause any problem?
Original
<script src='https://www.wp.org/wp-content/plugins/wpforms/pro/assets/js/vendor/jquery.intl-tel-input.min.js?ver=15.0.0'></script> <script src='https://www.wp.org/wp-content/plugins/wpforms/assets/js/jquery.validate.min.js?ver=1.19.0'></script> <script src='https://www.wp.org/wp-content/plugins/wpforms/assets/js/mailcheck.min.js?ver=1.1.2'></script> <script src='https://www.wp.org/wp-content/plugins/wpforms/assets/js/wpforms.js?ver=1.5.5.2'></script> <script> var wpforms_settings = {"val_required":"This field is required.","val_url":"Please enter a valid URL.","val_email":"Please enter a valid email address.","val_email_suggestion":"Did you mean {suggestion}?","val_email_suggestion_title":"Click to accept this suggestion.","val_number":"Please enter a valid number.","val_confirm":"Field values do not match.","val_fileextension":"File type is not allowed.","val_filesize":"File exceeds max size allowed.","val_time12h":"Please enter time in 12-hour AM\/PM format (eg 8:45 AM).","val_time24h":"Please enter time in 24-hour format (eg 22:45).","val_requiredpayment":"Payment is required.","val_creditcard":"Please enter a valid credit card number.","val_smart_phone":"Please enter a valid phone number.","val_post_max_size":"The total size of the selected files {totalSize} Mb exceeds the allowed limit {maxSize} Mb.","val_checklimit":"You have exceeded the number of allowed selections: {#}.","post_max_size":"2097152000","uuid_cookie":"1","locale":"en","wpforms_plugin_url":"https:\/\/www.wp.org\/wp-content\/plugins\/wpforms\/","gdpr":"","ajaxurl":"https:\/\/www.wp.org\/wp-admin\/admin-ajax.php","mailcheck_enabled":"1","mailcheck_domains":[],"mailcheck_toplevel_domains":[],"currency_code":"USD","currency_thousands":",","currency_decimal":".","currency_symbol":"$","currency_symbol_pos":"left"} </script>
I want to replace as below
<script> var wpforms_settings = {"val_required":"This field is required.","val_url":"Please enter a valid URL.","val_email":"Please enter a valid email address.","val_email_suggestion":"Did you mean {suggestion}?","val_email_suggestion_title":"Click to accept this suggestion.","val_number":"Please enter a valid number.","val_confirm":"Field values do not match.","val_fileextension":"File type is not allowed.","val_filesize":"File exceeds max size allowed.","val_time12h":"Please enter time in 12-hour AM\/PM format (eg 8:45 AM).","val_time24h":"Please enter time in 24-hour format (eg 22:45).","val_requiredpayment":"Payment is required.","val_creditcard":"Please enter a valid credit card number.","val_smart_phone":"Please enter a valid phone number.","val_post_max_size":"The total size of the selected files {totalSize} Mb exceeds the allowed limit {maxSize} Mb.","val_checklimit":"You have exceeded the number of allowed selections: {#}.","post_max_size":"2097152000","uuid_cookie":"1","locale":"en","wpforms_plugin_url":"https:\/\/www.wp.org\/wp-content\/plugins\/wpforms\/","gdpr":"","ajaxurl":"https:\/\/www.wp.org\/wp-admin\/admin-ajax.php","mailcheck_enabled":"1","mailcheck_domains":[],"mailcheck_toplevel_domains":[],"currency_code":"USD","currency_thousands":",","currency_decimal":".","currency_symbol":"$","currency_symbol_pos":"left"} </script> <script defer src='https://www.wp.org/wp-content/plugins/wpforms/pro/assets/js/vendor/jquery.intl-tel-input.min.js?ver=15.0.0'></script> <script defer src='https://www.wp.org/wp-content/plugins/wpforms/assets/js/jquery.validate.min.js?ver=1.19.0'></script> <script defer src='https://www.wp.org/wp-content/plugins/wpforms/assets/js/mailcheck.min.js?ver=1.1.2'></script> <script defer src='https://www.wp.org/wp-content/plugins/wpforms/assets/js/wpforms.js?ver=1.5.5.2'></script>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Load the sources as defer’ is closed to new replies.