Let's suppose we have this js function into a local file, no server involved:
function splitView()
{
var tgtSrc = location.href;
var frameset = '<frameset rows="*,*">' +
'<frame name="' + upFrame + '" src="' + tgtSrc + '">' +
'<frame name="' + dwFrame + '" src="' + tgtSrc + '">' +
'</frameset>';
document.write(frameset);
}
that creates two named frames with the same document loaded.
Is that possible to synchronize 2 frames (not iframes!) content without reloading the document? Or at least is it possible to send data or any kind of signal from one frame to another to let the upFrame now that there are edits into the dwFrame that need to be loaded into its own content?
I know that there are limitations due to same origin policy while trying to get data from another frame, but in this case I want the dwFrame to send some message to the upFrame (I don't care about old browser compatibility just standard and modern ones).
Why I'll use it?
I have a bunch of tables into a LOCAL html file (no web server involved) that loads data from a csv file and I need to compare data from different points or to keep the header fixed on top while scrolling the rest of a specific table table or while inserting new data in one of them.
Edit of 17.02.2018
I'd try to implement a sync procedure using the session storage. What do you think?
Edit of 18.02.2018
Constraints:
- The ideal solution has to: Grant automatic synchronization between two frames
- The synchronization has to be bidirectional: if the user modify data into one frame the other get in sync, doesn't matter what frame is the origin and what the destination
- It doesn't affect too much browser performances
- The sync event is fired only if and when needed (when data into one frame or the other has changed)