WordPress.org

Support

[Resolved] javascript on all pages

  • Pepperbase

    @pepperbase

    Hi,

    Great plugin. Using 3.0.

    Was looking at my site’s loading times and saw that the Leaflet Maps Marker is loading JS files on all pages, also those without maps. Is there an option to only include JS on pages where there is actually a map included? Or should I manually deregister the scripts on other pages?

    Thanks.

    http://wordpress.org/extend/plugins/leaflet-maps-marker/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author RobertHarm

    @harmr

    Hi,
    currently not possible (yet) to configure this in the plugin as there are some difficulties I couldnt solve yet – I havent found a way yet how to check if my shortcode is used in a content and embedd js+css files afterwards only…
    regards,
    Robert

    PS: as I give support for free, I’d really appreciate a vote for my plugin on http://wordpress.org/support/view/plugin-reviews/leaflet-maps-marker 😉

    Pepperbase

    @pepperbase

    Hi,

    Good to know you are working on it.

    What are the (register) names of the JS an CSS files? I would like to deregister them manually on pages where I do not use maps.

    Regards.

    Pepperbase

    @pepperbase

    Already found it: leafletmapsmarker

    Plugin Author RobertHarm

    @harmr

    just found a solution (with help from John 😉 to include js in footer only if a shortcode is used 🙂 will be included in v3.1, which will be released in about 1 or 2 weeks probably

    Plugin Author RobertHarm

    @harmr

    Hi,
    FYI: I just release v3.1 which loads js in footer and only of a shortcode is used
    best regards,
    Robert

    Great that you have got this working now. Hopefully this becomes common practive among all plugin builders.

    Are there more loading time improvements on the roadmap?

    Are you going to do the same with the style sheet? Only add the css file when a shortcode is included?

    Plugin Author RobertHarm

    @harmr

    I try to follow the kaizen approach – continuos improvements step by step 😉 conditional css inserts are planned for v3.2

    if you have further suggestions how to improve performance, let me know!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] javascript on all pages’ is closed to new replies.
Skip to toolbar