Google Calendar Events
JS on every page (3 posts)

  1. enderandrew
    Posted 4 years ago #

    This works well, and the author provides great support.

    I'm just curious however if it is necessarily for the JS scripts to be loaded on every single page.


  2. Ross Hanney
    Plugin Contributor

    Posted 4 years ago #


    It certainly isn't necessary for the plugin JavaScript files to be loaded on every page. However, it's quite difficult to determine on which pages the JavaScript is required.

    For example, if you're using the shortcode on a particular page, the plugin doesn't "know" this until WordPress fires the plugin shortcode handling function, by which time it is too late to conditionally load the JavaScript files.

    The alternative is to "look ahead" into the page / post content and search for the shortcode at a time when scripts can be conditionally loaded, but this could potentially be very slow, and is perhaps outweighed by browser caching of files anyway.


  3. Ross Hanney
    Plugin Contributor

    Posted 4 years ago #

    Actually, I did just find this, which describes a better method of conditionally loading stuff.

    I'll certainly look into this again for the next release.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Calendar Events
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic