0
I’m developing a web project for real estate. On the page is the mirror of sales or the floor plan of the condominium of houses to be sold. When the user clicks on one of the plant houses, the system shows all the characteristics of that house. I am in doubt if it is better to load the page already put in the HTML itself in each house or button the information about the house... Ex:
<input id="casa02" type="button" alt="metragem=200m2*preço=R$80000*cor=branca" onclick="abrePopupDetalhes(this.id)"/>
...So when you click on it, javascript takes what’s in the "alt" and shows in the popup. This is just a simple example, in the real system are much more data than in this example. Or it is better to search the database for information every click?
That is, is it more harmful the html of the page get heavier or the page access the server every click? I’m worried about mobile access because of 3G.
The ideal is to load and show only what matters and is visible on the screen, as images, for example. In the case of images, there is a plugin called lazyload that only loads images when it is scrolled on the screen. This saves a lot of bandwidth and makes the page faster to load.
– Sam