Looking for the optimal method to load different div elements based on the device accessing my website without relying on user agent checks. As of now, I am utilizing CSS media queries to determine device specifications and display the appropriate div accordingly. However, both divs are being loaded regardless of the device, which is not ideal. Is there a way to only load the corresponding div?
In addition, resizing the desktop browser to match the dimensions of a mobile device should trigger the loading of the mobile div. Any suggestions on achieving this seamlessly?
Thank you for your input.