A coding standard issue has been raised today. The question regards loading static modal content on page generation, or not?
I have a bunch of modal popups which can appear on every page that are all static content. I decide to load this modal popup content into the DOM from the server-side. This adds several <div> elements to the DOM at the end of the page.
The additional html/DOM elements is exactly 6770 bytes of data uncompressed (No GZIP) and 1650 bytes compressed (With GZIP).
I have been told that it would be better practice to load the modal popup content using AJAX. I agree that dynamic content should be loaded using AJAX, but this content is on every page and I feel that it will offer a better User Experience having login popups loaded instantly.
I have discussed this with some colleagues and none of us can agree the best approach.
We understand the pros and cons, but in the situation above, which is best; AJAX or not?