Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A variation on the page example is to work with complete HTML documents, rather than fragments. The basic approach is the same, but I can include script and link elements to load JavaScript and CSS files that are specific to the document. This means I can keep my callback definition code and CSS styles separate from the rest of the application. To begin, I create a new folder called pages and another one called itemDetail inside it. I then add a new HTML file called itemDetail.html, which is shown in Listing 3-13.
Listing 3-13. The itemDetail.html File
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="itemDetail.js"></script>
<link href="itemDetail.css" rel="stylesheet">
</head>
<body>
<div id="itemEditor">
<div>
<label for="item">Item:</label><input id="item">