• Resolved markifornia

    (@markifornia)


    CSS and Javascript dependencies for this plugin are injected within the header slowing down load time. Is there an option to externalize CSS and Javascript (injecting javascript within the footer) to improve performance?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Heateor Support

    (@heateor)

    You can enable Include Javascript in website footer option at Super Socializer > General Options page in admin area to include these files in footer.

    Thread Starter markifornia

    (@markifornia)

    Thanks what about the CSS in the header, can they be externalized?

    Plugin Author Heateor Support

    (@heateor)

    According to W3C specs:

    A "link" element must have a "rel" attribute.
    If the "rel" attribute is used, the element is restricted to the "head" element.

    In addition to above, if you include CSS in footer your page will load without CSS for a while before the CSS in the footer has been loaded and would seem broken. So, it’s not a good idea to load CSS in footer.

    Thread Starter markifornia

    (@markifornia)

    I did check that box but the related scripts are still in the head area. See below code snippet.

    In regards to CSS, I’m not looking to place them in the footer but externalize the CSS in a different file. See code snippet below.

    <script>function theChampLoadEvent(e){var t=window.onload;if(typeof window.onload!="function"){window.onload=e}else{window.onload=function(){t();e()}}}</script> <script>var theChampSiteUrl = 'https://testsite.ca/blog-ch', theChampVerified = 0, theChampEmailPopup = 0;</script> <script>var theChampSharingAjaxUrl = 'https://testsite.ca/blog-ch/wp-admin/admin-ajax.php', heateorSsUrlCountFetched = [], heateorSsSharesText = 'Shares', heateorSsShareText = 'Share', theChampCloseIconPath = 'https://testsite.ca/blog-ch/wp-content/plugins/super-socializer/images/close.png', theChampPluginIconPath = 'https://testsite.ca/blog-ch/wp-content/plugins/super-socializer/images/logo.png', theChampHorizontalSharingCountEnable = 1, theChampVerticalSharingCountEnable = 0, theChampSharingOffset = -10, theChampCounterOffset = -10;</script> <style type="text/css">.the_champ_horizontal_sharing .theChampSharing{
    					color: #fff;
    				border-width: 0px;
    		border-style: solid;
    Plugin Author Heateor Support

    (@heateor)

    Above Javascript and CSS is generated dynamically based on the plugin options you have saved. It’s not static. So, it’s not possible to externalize it in a separate file. And this dynamically generated Javascript should be loaded in head for plugin to work properly.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Externalize Javascript and CSS’ is closed to new replies.