HTML and CSS Reference
In-Depth Information
One problem with direct DOM manipulation is that it directly connects the two documents;
each document has to have detailed knowledge of the structure of the other in order to ma-
nipulate each other to share information. HTML5 provides a much-improved solution in
the form of cross-document messaging and channel messaging, illustrated in figure 1.10 .
Figure 1.10. A simple application demonstrating channel messaging. You'll build this in appendix J , one of the
companion appendices to chapter 4 .
Cross-document messaging enables documents to communicate with each other via mes-
sages—one document posts a message, and the other document has an event handler re-
gistered to listen for any messages posted by the other document.
Another issue with direct DOM manipulation surfaces when you consider the security of
including remote script files in your application—a common use case for implementing the
likes of Google Analytics and Facebook “Like” buttons in your applications. These scripts
 
Search WWH ::




Custom Search