This example shows how to use the HTML Frame Mojit ( HTMLFrameMojit) to
create the skeleton of an HTML page and embed rendered template into the
page. The HTMLFrameMojit creates the <html>, <head>, and <body>
tags and embeds the rendered templates of the child mojits into the <body>
tag. To be clear, although the name HTMLFrameMojit contains the string
“frame”, the HTMLFrameMojit does not create HTML frame or iframe
elements. This example only uses one child mojit, but you can configure the
application to use many child mojits. For more information, see
HTMLFrameMojit.

The screenshot below shows the page served by your application, where the visible
content is created by the child mojit of HTMLFrameMojit.

The HTMLFrameMojit is a reusable component that is available in every Mojito
application. To configure the HTMLFrameMojit, you use the application.json
file. In this example application.json, the frame object has a type
property that specifies that HTMLFrameMojit create the HTML framework and
embed the rendered view from the child mojit.

The Mojito server returns the HTML below to the client. The HTMLFrameMojit is
responsible for the tags that comprise the skeleton of the HTML page and inserting the
value of the title property in application.json into the <title> element,
and the child mojit creates the content that is embedded in the <body> tag. In this
example, the child mojit creates the <div> tag and its content.

The HTMLFrameMojit mojit can be used to allow dynamic runtime selection of running
on the client or server. You can also use HTMLFrameMojit to include assets and control
language defaults. These subjects are discussed in
Internationalizing Your Application.