Modal; To Add to the DOM on server side, or not

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

seocrusader
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Feb 11, 2014 3:25 am

Modal; To Add to the DOM on server side, or not

Postby seocrusader » Tue Feb 11, 2014 3:43 am

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?

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest