I inserted the following code in a WordPress plugin:
wp_deregister_script('jquery'); wp_register_script('jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"); wp_enqueue_script('jquery'); The following is echoed to the browser:
<script type='text/rocketscript' data-rocketsrc='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?ver=3.3.1'></script> Instead of:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script> I don't know what is happening. Perhaps wp_register_script() is supposed to work in this way. I also tested if any jQuery code worked on the client side but it didn't.
JavaScript can be used within the WordPress platform to add dynamic elements to pages and posts, or across your entire website. In this article we'll take a look at JavaScript, what it is, and how you can use it to enhance your WordPress digital experiences.
You can use wp_deregister_script, this will remove unwanted JS,CSS from specific pages. Using the function described it recognizes the page(s), good. In the particular plugin there are 20+ js calls.
It is easy to fix.
You must change the following tag: <script type="text/javascript"></script>
add: data-cfasync="false"
example:
<script data-cfasync="false" type="text/javascript"></script>
Probably one of wordpress plugins is using CloudFlare.
https://support.cloudflare.com/hc/en-us/articles/200168056-What-does-Rocket-Loader-do-
Try disabling all the plugins and re-enabling them one by one to find out which one is causing this issue. It's not a problem actually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With