Using frames you can refresh a given frame without reloading the others, this is good for minimizing (c/s) transfers. Our model is based on the following scheme:
We can analyze the method as following:
We have 3 files:
|"master"||(very heavy, with display function and storage variables and initial values)|
|"loader"||(light, php code to retrieve data from the server and write JS code)|
|"display"||(VERY light, just a call to a display function in "master")|
Master is transfered only once.
Loader and display are transfered each "x" seconds.
Loader may be big the first time it is called, then it is a very short file since only the data that the client has not received is transfered.
Display is always the same.
The "nice" display generation is processed in the client so we reduce the server load.
Are you confused? Let's see an example:
In this example we build a chat room which is not usable yet, we just show how to implement this model, please don't say "why don't you do this and that to the chat room...". You can build a chat room as complex as you want using this model if you find it useful, and remember it is not only useful for chatrooms.