Set include of js as async

This commit is contained in:
Laurent Destailleur 2021-04-03 13:24:34 +02:00
parent 231f441876
commit 17437670b1

View File

@ -250,7 +250,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
// Add js
$tplcontent .= '<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
$tplcontent .= '<!-- Include link to JS file -->'."\n";
$tplcontent .= '<script src="/javascript.js.php"></script>'."\n";
$tplcontent .= '<script async src="/javascript.js.php"></script>'."\n";
// Add headers
$tplcontent .= '<!-- Include HTML header from common file -->'."\n";
$tplcontent .= '<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?>'."\n";