If you have used document.createElement or document.appendChild, you have worked with the DOM API. The DOM API is a collection of objects that JavaScript can use to interact with the browser to modify the DOM. It may feel as though you are jumping from page to page, but you are actually still on the same HTML page and JavaScript is doing the heavy lifting. JavaScript destroys and creates a new user interface as the user interacts with the application. As users navigate through the site, they actually stay on the same page. In an SPA, the browser initially loads one HTML document. Since browsers could request and load tiny bits of data using AJAX, entire web applications could now run out of a single page and rely on JavaScript to update the user interface. The invention of AJAX brought us the single-page application, or SPA. When the user navigated these pages, the browser would request and load different HTML documents. Traditionally, websites have consisted of independent HTML pages. We could say that the root element has three children: a heading, an unordered list of ingredients, and a section for the instructions. In HTML, elements relate to each other in a hierarchy that resembles a family tree. Remove from oven and let cool for 15 minutes. Add the yellow squash and put back in the oven for 30 mins. Add the salmon, garlic, and pine nuts to the dish. Spread the olive oil around a glass baking dish. A possible solution for such a task might look something like this: Baked Salmon 1 lb Salmon 1 cup Pine Nuts 2 cups Butter Lettuce 1 Yellow Squash 1/2 cup Olive Oil 3 cloves of Garlic Cooking Instructions Preheat the oven to 350 degrees. Let’s say that you have to construct an HTML hierarchy for a recipe. The elements that make up an HTML document become DOM elements when the browser loads HTML and renders the user interface. HTML is simply a set of instructions that a browser follows when constructing the document object model, or DOM.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |