• Hi team, I installed the jetpack boost plugin and it really helped me boost my site speed. However, I noticed after enabling the “Defer Non-Essential JavaScript” on the boost, my site’s menu becomes invisible on the desktop and inaccessible on the mobile version of my site. Also, my search bar doesn’t work after activating the Defer Non-Essential JavaScript on desktop and mobile but every other thing works just fine. How do I fix this, please?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Adewale Mudasiru

    (@whaletb)

    I also just noticed some elements are not displaying (share buttons) and images in between contents are not displaying.

    Hi @whaletb,

    Thanks for reporting this! Right now, Defer JS is a bare-bones feature that simply moves all <script> tags down to the very bottom of the page when enabled. We’ve got some plans in the works that may improve this feature and experience in the future though.

    If your theme’s menu, search bar, and other elements like share buttons and images heavily depend on JavaScript to be loaded, differing JavaScript in the way that Boost currently does it might not be a great performance boost path to take.

    One thing you could do instead to improve the loading time/speed of your JS files while making sure your site still works is to use the Jetpack Site Accelerator to load static files (like CSS and JavaScript) for your site.

    Hope that helps!

    Hi again,

    I should mention that the Defer JS works rather well in most cases. Moving scripts down in the HTML is remarkably effective. We have plans to explore the use of defer tags but have not come around to it yet and are not yet certain it will actually improve the feature.

    In general, if you have specific scripts (such as those responsible for your menu and search bar functionality) that you do not want to be deferred, you can tell Jetpack Boost not to defer them by adding the attribute data-jetpack-boost="ignore" to the script tag. E.g. <script data-jetpack-boost="ignore"> Please note that you must use double quotes as of Jetpack Boost 1.4.0, but that’s a requirement that is going to be dropped in 1.4.1.

    I’ll also make sure to update our public documentation with this information. Thanks for reaching out!

    • This reply was modified 2 years, 8 months ago by Daniel.
    • This reply was modified 2 years, 8 months ago by Daniel.
    Thread Starter Adewale Mudasiru

    (@whaletb)

    While I’d love to give the ignore attribute a try, I’m not experienced and don’t know how to look for a particular JavaScript to make an edit.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hey @whaletb,

    I’m sorry to hear that as we can’t help much about this since it goes beyond the scope of our support.

    If you still intend to make this change, you may want to check around if there’s an easy how-to JavaScript guide you can for this purpose.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search and menu not working’ is closed to new replies.