Multiple iframe is often used to display the main and sub-relationships (master and sub-Orders) of the domain model. The test shows that iframe has the cache function. When the first time you enter an iframe {A} from the main window, at this time, the data presented in {A} is new, and I clicked another iframe for short {B}. Here, the data in {B} is also new, perform some logic processing in {B}. For example, add model data in batches to {A}. Here we enter {A} And we will find that the data is cached. Because {A} data is operated in batches from {B}, {B} communicates with the server, that is, it performs logical/persistent layer operations, in this way, the server updates are presented in part {B} rather than all, that is, partial refreshing, only refreshing {B }. What we need to do is to change the content in {.
Solution:
· Obviously, iframe. window. location. reload (); does not meet the current requirements.
· Use window. setTimeout (iframe. window. loadction. reload (), 1000); this method will cause multiple refreshes. What if we want to update the data of {B} in {?
· After studying for a long time, you can solve the iframe cache problem directly. It is easy to simply prevent it from being cached. If you do not cache it, you do not need to refresh it.
Example:
The Code is as follows:
Function doInsert2BatchCallBack (){
Var pIf = parent.doc ument. getElementById ('iframe _ ');
PIf. src = pIf. src + "&". concat (Math. random ());
// Submit a batch import request
}