Support » Plugin: Reduce Bounce Rate » vanilla javascript, please

  • Hello,

    I have one request please: make the plugin a vanilla javascript. When I activate the plugin, jquery is loaded and this duplicate the whole website weight size.

    Thank you very much for the awesome plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    Are you talking about this jquery?

    $j=jQuery.noConflict();$j(document).ready(function(){$j(".jbut").click(function(){$j(this).next(".jslid").slideToggle("slow")})});

    Hi,

    Thanks @jeroent for your reply.

    When I activate the plugin these 2 lines are added to html:

    <script type="text/javascript" src="http://mydomain.com/wp-includes/js/jquery/jquery.js?ver=1.12.4"></script>
    <script type="text/javascript" src="http://mydomain.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1"></script>

    Is it possible to disable them ?

    And if you check plugin code you can find:

    $(document).scroll(function(a){for(iz=0;iz<ScrollMatrix.length;iz++){if(($...

    The $ sign means the plugin uses jQuery.

    The issue is when you use caching plugin like autoptimize, you will have those errors:

    Uncaught TypeError: $ is not a function

    Uncaught ReferenceError: ga is not defined

    Please make vanilla javascript solution if it’s possible.

    Thanks
    (sorry for my english)

    • This reply was modified 1 year, 4 months ago by charafweb.
    • This reply was modified 1 year, 4 months ago by charafweb.
    Plugin Author Okoth1

    (@okoth1)

    Hello,

    What theme do you use? When I use the Twenty Fifteen theme the lines of code you posted are included. Without using my plugin.

    @okoth1 Sorry for the late reply.

    I’m using GeneratePress.

    From GeneratePress doc:

    NO DEPENDENCIES

    If it’s not needed, we don’t load it. That includes jQuery, which we ditched for clean, vanilla javascript. No more render blocking issues!

    Plugin Author Okoth1

    (@okoth1)

    I’ll change it in a next version of the plugin.

    @okoth1 Thanks a ton man 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘vanilla javascript, please’ is closed to new replies.