defer, lateLoader, move serviceworker, smallscript

This commit is contained in:
Felix Schulze 2019-11-05 20:28:56 +01:00
parent 3445f8ad89
commit 31e7355725
4 changed files with 22 additions and 34 deletions

View File

@ -18,12 +18,10 @@
<script async src="assets/js/modernizer-webp.js"></script>
<link rel="stylesheet" async href="assets/css/main.min.css">
<link rel='preload' async href='assets/img/background85.webp' as='image' type='image/webp'>
<link rel="stylesheet" async href="https://fonts.googleapis.com/css?family=Roboto&display=swap">
<link rel="stylesheet" defer href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" defer href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" defer href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css">
<script data-ad-client="ca-pub-5143923140938916" defer src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<link disabled class="lateLoader" rel='stylesheet' defer href='https://fonts.googleapis.com/icon?family=Material+Icons'>
<link disabled class="lateLoader" rel="stylesheet" defer href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css">
<!--<script data-ad-client="ca-pub-5143923140938916" defer src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
-->
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
@ -81,16 +79,10 @@ Information om själva sidan hittar du i "Om oss" rutan på startsidan.
</content>
</div>
</header>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="assets/js/material.min.js"></script>
<script src="assets/js/loader.min.js"></script>
<script src="assets/js/softscrollscript.js"></script>
<script>
if('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js');
});
}
</script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script defer src="assets/js/material.min.js"></script>
<script defer src="assets/js/loader.min.js"></script>
<script defer src="assets/js/softscrollscript.js"></script>
<script defer src="assets/js/smallscript.js"></script>
</body>
</html>

View File

@ -0,0 +1,9 @@
if('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js');
});
}
window.addEventListener('load', function() {
$(".lateLoader").prop('disabled', false);
});

View File

@ -1,6 +1,6 @@
<?php
echo "
<script>
<script defer>
";
readfile("https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js");
readfile("https://code.getmdl.io/1.3.0/material.min.js");
@ -9,6 +9,7 @@ readfile("assets/js/loader.min.js");
readfile("assets/js/calcscript.js");
readfile("assets/js/changeall.js");
readfile("assets/js/sparabetyg.js");
readfile("assets/js/smallScript.js");
echo "
$(document).ready(function() {
$('select').material_select();
@ -23,10 +24,5 @@ function partB(){
$('select').material_select();
});
}
if('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js');
});
}
</script>
";

View File

@ -25,7 +25,7 @@
<script async src="assets/js/modernizer-webp.js"></script>
<link rel="stylesheet" async href="assets/css/main.min.css">
<link rel='preload' async href='assets/img/background85.webp' as='image' type='image/webp'>
<link disabled id="test" rel="stylesheet" defer href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css">
<link disabled class="lateLoad" rel="stylesheet" defer href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css">
<!--<script data-ad-client="ca-pub-5143923140938916" defer src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
-->
@ -141,15 +141,6 @@ När jag började informera mig om Universiteter, antagningspoäng och meritvär
<script defer src="assets/js/material.min.js"></script>
<script defer src="assets/js/loader.min.js"></script>
<script defer src="assets/js/softscrollscript.js"></script>
<script defer>
if('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js');
});
}
window.addEventListener('load', function() {
$("#test").prop('disabled', false);
});
</script>
<script defer src="assets/js/smallscript.js"></script>
</body>
</html>