From: Zachary Vance Date: Fri, 18 Apr 2025 23:07:29 +0000 (-0400) Subject: defer a script; jquery X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=2453368775399e9b1b5908a1ba80f212ecb97776;p=za3k.git defer a script; jquery --- diff --git a/html-css-cheatsheet.html b/html-css-cheatsheet.html index 0ce8ea7..9aae61e 100644 --- a/html-css-cheatsheet.html +++ b/html-css-cheatsheet.html @@ -3,7 +3,6 @@ @@ -185,9 +184,13 @@ <script src="jquery.min.js"></script> </head> <p>Hello World</p> -<script>$("p").css("color", "yellow");</script> +<script>$("p").css("color", "yellow");</script> +<script src="https://ajax.googleapis.com/ajax/libs + /jquery/3.7.1/jquery.min.js"></script> + JS is executed immediately. If your JS is included at the top of a file, delay it until document load: