The Body: Markup Layer
Now that we have our script includes and styles, let’s take a quick look at the markup that we will be generating for this example:
<body>
<form action="javascript:void(0);">
<div id="errorMsg"></div>
<input type="text" name="file" id="file" />
<input type="submit" value="Load File" onclick="getFile()">
</form>
<div class="contentBox contentRendered">
<div class="header">Original Content: Rendered</div>
<div id="original_rendered"></div>
</div>
<div class="contentBox contentRendered">
<div class="header">Cajoled Content: Rendered</div>
<div id="cajoled_rendered"></div>
</div>
<div class="clear"></div>
<div class="contentBox contentRaw">
<div class="header">Original Content: Raw</div>
<div id="original_raw"></div>
</div>
<div class="contentBox contentRaw">
<div class="header">Cajoled Content: Raw</div>
<div id="cajoled_raw"></div>
</div>This content consists of two parts:
The form that includes an input box to enter the file location from which we will load our example content. When the user clicks the submit button, the
getFile()function will be called to collect the file content. This form also includes an error messaging node that we’ll use to display a basic message to the user if there is a problem loading the file.The
divnodes that make up the four quadrants of our example:The rendered original content (top left).
The raw original content (bottom left).
The rendered cajoled content (top right).
The raw cajoled content (bottom right).
Now that we have the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access