Support » Plugins and Hacks » Simple Calendar - Google Calendar Plugin » [Plugin: Google Calendar Events] JS on every page

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ross Hanney

    (@rosshanney)


    Hello,

    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.

    Ross.

    Plugin Contributor Ross Hanney

    (@rosshanney)


    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.

    Thanks!
    Ross.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Google Calendar Events] JS on every page’ is closed to new replies.