§ Even Faster Webpages
A couple of things to make pages a little faster than what I wrote in Faster webpages.
First off, I categorically stated that JavaScript needed to go in the head element of the page, even if it did seem to work placed at the bottom of the body. At the time, that's what the rules required, but now it is proper to place it at the end of the body.
Another thing that can help is headjs.com. It allows you to easily load additional JavaScript or CSS after the page onload event. For example:
head.load("jquery.min.js", function() { //code here runs after jQuery is loaded and ready head.load("colorbox.js", function() { //here colorbox is finished loading $(".colorbox").colorbox(); }); });
headjs can also check for supported browser features so you can decide which bells and whistles to include.
I mentioned compression in the earlier post, but pages can also be compressed in advance rather than having the server do it when needed: kevinlocke.name/bits/2016/01/20/serving-pre-compressed-files-with-apache-multiviews/
I'm working on this for the next site update, so more later.
last edited on September 5th, 2017 at 9:59 PM
- Walid on "Adventures with Ubuntu 9.10 on G4 Yikes!" - I am in the same process as you. Although I still dual-boot to Windows for my ganimg leisure. My first contact with Ubuntu was way…
- Slashback on "Simpler adding & removing element classnames" - Actually, the addClassName function does what you want, pretty much the same way you suggest.
- angie on "Simpler adding & removing element classnames" - And what if I want to add a class, but keeping the csseals the element already has?I mean, I have an element with a class, let's name…
- backlinks on "Adjust iframe height to contents" - Definitely helped me.
- Slashback on "Simpler validate form fields are filled in (no additional class names)" - You are welcome!