New to Chrome 77 and also Edge (Chromium) is the native functionality to lazy load images, that is to only request images when the user scrolls the page to a certain position. Although this position is calculated in the browser (I don't know the formula), images are loaded up when it scrolls near to the image position.

It can be achieved by using the loading attribute with a value of lazy in an image element and can also be part of a Picture element as well.

An example with a standard image element:-

An example with a picture element:-

It currently works in Edge (Chromium) Version 81.0.381.0 and Chrome 77 but not Firefox as of version 72.0.1 that I tested with.

By omitting the loading attribute, the browser wil default to auto which means it will determine if the image should be lazy loading. To override this use the eager value which will load the image on page load.

What about a fall back?

For unsupported browsers such as Firefox, Edge Version 44 and of course IE, it is possible to replicate the functionality using a poly fill like this:-

Happy coding

As the festive season has come and gone and things are picking up again, I thought I would post a personal item about how I got into developing on the .Net stack. Feel free to add YOUR story to the comments section below.

It all started around the summer of 2001 while I was working for the NHS here in the UK. I had only been working there since the January and was brought in to create and maintain the Intranet that the Hospital Trust was using for all internal communication outside email. I was developing using classic asp back then on the Microsoft Visual InterDev platform. Then one day my manager came in and dropped a folder of CD ROM's onto my desk and asked me if I could have a look at it and see if it is of any use. I think she was handed it to her whilst at a developer conference the previous week in London. Anyway it turns out to be Visual Studio .Net beta and I happily installed all 5 disks of it. Now what?

I tried getting into creating a web application as well as a desktop application using Visual Basic .Net, but I admitted defeat and went back to my usual day to day work of developing classic asp.

Then a few days later I had another attempt and did get a bit further, but I wanted database connectivity and a simple grid to display it without having to mess around with paging and master detail pages. So again I gave up.

A few days later I was handed an issue of the newly published .Net Magazine (I think it was called) and on the front cover was an introduction to .Net and the new C# language. I delved right in and along with the 4 guys from Rolla website I managed to get a simple web application up and running, connecting to a database and display the data the way I wanted.

Soon I was getting more experienced, to the point that I proposed the whole Intranet be rewritten in .Net 1.0 when it came out officially. My manager was happy with this as she saw it as future proofing the project. It didn't take too long to redevelop the whole thing as there wasn't much in the way of dynamic pages at that point. Running on .Net with a SQL Server back end gave us scope to add much more functionality than there was on the original site. Some of the functionality included a calendar of events for the hospital, a chat client, classified adverts posting and even a CMS so I could hand over the publishing to an editor. As soon as .Net 1.1 came out, the site was again migrated as 1.1 was not compatible with 1.0. Whilst working at that NHS trust, I also developed information portals for local GP practices to share data with the hospitals in the trust and even created XML data feeds (before WCF) to help with this. All this was developed using Visual Basic .Net as my main experience before this was Visual Basic v5 and v6. However this was the last place I used it as after this I trained myself up to use C# using Bob Tabors excellent Learn Visual Studio.Net.

Fast forward 11 years and several job moves I ended up contracting where my first client was the same NHS Trust I started in. To my surprise the Intranet was still running on the technology stack that I created it with all those years before. They had plans on moving over to SharePoint in the near future, but it was good to see an old project still running.

So that is my story, how did you get into .Net development?

Happy New Year and happy coding.

HTTP Endpoint Monitoring for both Windows and Android
WebUp App