mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
RM: Ajax Preload
This commit is contained in:
parent
fd72eb62e7
commit
a4d463e99d
@ -241,8 +241,8 @@ class DeferredRequirements implements TemplateGlobalProvider
|
||||
}
|
||||
unset($fonts, $font);
|
||||
|
||||
$preloadPath = Controller::curr()->Link().'?ajax=1';
|
||||
$html .= '<link rel="preload" as="fetch" href="'.$preloadPath.'" />'."<script>fetch('".$preloadPath."', {method:'GET',credentials:'include',mode:'cors'}).then((r)=>{return r.json()}).then((d)=>{window.preloadedData = d})</script>";
|
||||
/*$preloadPath = Controller::curr()->Link().'?ajax=1';
|
||||
$html .= '<link rel="preload" as="fetch" href="'.$preloadPath.'" />'."<script>fetch('".$preloadPath."', {method:'GET',credentials:'include',mode:'no-cors'}).then((r)=>{return r.json()}).then((d)=>{window.preloadedData = d})</script>";*/
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user