Methods of presenting an SPA container
In a Single Page Application, the container is the object in which the application is initially loaded and displayed to the user. This concept is different from that of a software container, which is an isolated environment that an application lives in, much like a virtual machine.
For a single page web application, the container could be the <body>
element, or any element within the <body>
element. For instance, you may have some static welcome text initially loaded on the page in a <p>
element, and the SPA will then load dynamically below that element in a <div>
element:
<!doctype html> <html> <body> <p>This is some welcome text.</p> <div class="container"> The application will be loaded here. </div> </body> ...
Get Mastering JavaScript Single Page Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.