test
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • portalion Friend
    #192005

    Hi,
    I would like to receive assistance in putting async atribute in <script….> in HEAD section of webpage.

    I have 2 scripts i’d like to load asynchronously:

    First:
    Currently in my sourcecode it looks like this:
    <script src=”/index.php?jat3action=gzip&jat3type=js&jat3file=t3-assets%2Fjs_2d219.js” type=”text/javascript”></script>

    and I would like it to look like this:
    <script async src=”/index.php?jat3action=gzip&jat3type=js&jat3file=t3-assets%2Fjs_2d219.js” type=”text/javascript”></script>

    Second
    <script type=”text/javascript” src=”http://www.website.com/plugins/content/sige/plugin_sige/milkbox.js”></script>

    and I would like it to look like this:
    <script async type=”text/javascript” src=”http://www.website.com/plugins/content/sige/plugin_sige/milkbox.js”></script>

    Where are the files to modify?

    Looking forward

    Saguaros Moderator
    #511430

    Hi portalion,

    You can try this way:

    – Copy file: pluginssystemjat3jat3base-themesdefaultpagedefault.php

    – Paste it into template folder: templatesja_teline_ivpage (if there is no ‘page‘ folder, you can create it)

    – Add your own script in Head section of this file.

    Once done, remember to clean JAT3 cache.

    Hope this helps.

    portalion Friend
    #511662

    Hi Saguaros

    I suppose I must have put my requst in the wrong way.
    I will try to put it clearer:

    In the sourcecode of my webpage (in the browser) in HEAD section I may notice two lines of code I want to change.
    These lines are generated automaticaly by Joomla.
    Here they are:

    [PHP]<script src=”/index.php?jat3action=gzip&jat3type=js&jat3file=t3-assets%2Fjs_2d219.js” type=”text/javascript”></script>[/PHP]
    [PHP]<script type=”text/javascript” src=”http://www.website.com/plugins/content/sige/plugin_sige/milkbox.js”></script>[/PHP]

    I want to change these lines of code to look like this:

    [PHP]<script async src=”/index.php?jat3action=gzip&jat3type=js&jat3file=t3-assets%2Fjs_2d219.js” type=”text/javascript”></script>[/PHP]
    [PHP]<script async type=”text/javascript” src=”http://www.website.com/plugins/content/sige/plugin_sige/milkbox.js”></script>[/PHP]

    This means I want Joomla to add “async” to these lines while generating webpage code.

    May you come up with any solution?

    Looking forward

    Saguaros Moderator
    #512138

    Hi portalion,

    Actually, you should add ‘async=”async”‘, pls open file: pluginssystemjat3jat3corehead.php

    At line 187:
    [PHP]$document->addScript($url[1]);[/PHP]

    change it to:

    [PHP] $document->addScript($url[1], “text/javascript”, false, true);[/PHP]

    Then clean JAT3 cache.

    Hope this helps.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  Saguaros 11 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum