Jon Rumsey

An online markdown blog and knowledge repository.


Project maintained by nojronatron Hosted on GitHub Pages — Theme by mattgraham

Summarized topics

Introduction HTML Chapter 1: Structure HTML Chapter 17: Layout HTML Chapter 18: Process and Design JS Book Introduction JS The Art of Programming

From the Duckett HTML book

Introduction

The internet is a global network connecting computers together. Computers have unique IP addresses (like a home street address) allowing other computers to find them. A naming system called DNS is like a directory that provides a lookup of human-readable names like www.microsoft.com into ip addresses like 192.168.123.10. Web servers on the internet are like special file servers, hosting special files that web browsers can process and display on a users screen.
Web browsers interpret HTML to display text on the page, arranging text elements into different parts of the page or with different styles.
Cascading Style Sheets (CSS) are used to describe the layout and design details of the web page to a greater degree than HTML can do. CSS can change website colors, text properties like fonts and colors, and more.
HTML5 is the latest revision of the HTML specifications.

HTML Chapter 1: “Structure” (pp.12-39)

HTML

ATTRIBUTES

Attributes are key-value pairs that help describe content stored within HTML elements. An example attribute:
lang='en-us'[Duckett, pg.25].

BODY HEAD and TITLE

Body: Defines the area the browser will render. Think of this as the parent container for the entire web page.
Head: This element should be within the Body element, and defines any additional metadata about the web page.
Title: The Title tag should live within the Head.

HTML Chapter 8: “Extra Markup” (p.176-199)

HTML 4 was released in 1997, XHTML (based on XML) was released in 2000, and HTML5 was initially released in 2008 and is now considered a living standard (see Wikipedia). The most widely used browsers keep up with (or ahead of) HTML standards, and website developers must know how to tell the browser which version they are coding in.

ID ATTRIBUTES

These is global and can be applied to any html element, so each must be unique on each web page. Usage:<p id="id_name">text</p>. ID Attributes are used to allow styling elements differently than others on the page, by using CSS. JavaScript can leverage ID attributes to work with HTML elements.

CLASS ATTRIBUTES

Class attributes allow identifying many attributes within a page by applying CSS to the class-named elements. Usage:<p class="blue_font bold_font">text</p>. This will make the P element content font take on the CSS featured programmed for that class name (presumably bold and blue).

BLOCK AND INLINE ELEMENTS

Block elements cause content to always appear on a new line, whereas Inline elements continue on the same line as neighboring elements (and their content).

IFRAMES

Iframe is short for Inline Frame. It forms a window within a larger document to place images, video, or other information.

META TAGS

These live in the HEAD element and are not rendered in the browser, but they should contain descriptive information for the browser and Search Engines to use, like `author, description, published'... etc.

There are Search Engine properties, cache-controlling properties, and a viewport property.

ESCAPE CHARACTERS

Escape Characters allow display of reserved HTML characters like the less-than sign aka left-angled-bracket: <.
Use &lt or &#60 to display the < character otherwise the browser might not be able to render the page at all.
There are many other characters and special symbols like currency, the copyright symbol, and soome punctuation.
Advice: If the wrong character (or nothing) appears in the spot where a reserved HTML character is expected try changing the Font to fix the problem.

HTML Chapter 17: “HTML5 Layout” (pp.428-451)

This chapter discusses layout elements, how to get old browsers to understand html5 elements, and how to stylize elements with css.

TRADITIONAL HTML LAYOUTS

<div> Groups together related elements on the page.
class or id These attributes indicate the role of <div> elements.

HTML5 LAYOUT ELEMENTS

These elements are named after sectional areas of common web sites and have specific purposes that should be closely followed:

LINKING Around Block-level Elements
Html5 allows surrounding block-level elements with an anchor element. The entire block between the tags becomes an active link. Attempting this in previous html versions could result in rendering or the link not functioning.

HTML5 ELEMENTS IN OLDER BROWSERS

Html5 can be used in older browsers but will be treated as inline elements. Include a line of CSS that tells the browser the html5 elements should be rendered as block elements instead:

<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svc/trunk/html5.js"></script>
<![endif]>-->

HTML Chapter 18: “Process & Design” (pp.452-475)

OVERVIEW

The chapter covers a process for creating a new website, and includes suggestions for the design process. It is important to get to know your website visitors (current and potential), why they would visit the website and what they are looking for, and how the website will get them what they need. Information can be organized and stylized in ways that helps visitors meet their goals, as well as produce a professional and functional website.

WHO IS THE SITE FOR?

Determine who wants to use the site, but understand it cannot serve everyone. Acquire information from target audience, including demographics, to help design the site organization and design.

Develop a matrix of the above information so questions about what the website should look like, the information it will contain, and how the website will operate can be better answered during the design process.

WHY VISIT THE WEBSITE?

Visitors sometimes find wesites by chance, other time there are motivators and goals that drive users to a website. These should influence the design and content of the webiste.

WHAT ARE VISITORS TRYING TO ACHIEVE?

ID the key motivators and goals to help design the website appropriately for intended audience.
Create a list of reasons for various imaginary users to come to the website and use this as a guide in the design.

WHAT INFORMATION DO VISITORS NEED?

HOW OFTEN WILL PEOPLE VISIT?
Sites offering time-sensitive information or regularly changing information might see more users that other types of sites. The cost and effort to update a site regularly should be considered in site design to make it easy to update especially for higher-traffic sites. Consider settings scheduled site updates (quarterly, daily...whatever fits the goals of the users and purpose of the site). Regularly or often updated pages could see benefits over pages that are not updated as often.

For goods & services sites: [Duckett, pg.460]

How often do same people return to purchase from you?
How often is your stock updated or your service changed?
For Infomration sites: [Duckett, pg.460]
How often is the subject updated?
What percentage of visitors return for regular updates, compared with those that need the info just once?

SITE MAPS

WIREFRAMES

Wireframe tools list from [Duckett, pg.463]:

DESIGN TO GET MESSAGE ACROSS

Content should have been sorted out already, sonow the design needs to organize and prioritize the content to guide users and lead users to what they are looking for. Use styles to make portions of the page distinct from other content, calling it out to the user. Can also draw a user's attention away from content items.

Visual Hierarchy

The book has a visual hierarchy example [Duckett, pgs. 467-468] that I have arranged into key statements, below:

Related content should be put into "blocks" or "chunks" to keep it simple to follow and understand.

Use similar visual styles for similar content so users quickly associate the style with the purpose or information.

GROUPING AND SIMILARITY

"Grouping related pieces of information together can make a design easier to comprehend." [Duckett, pg.469]

Various ways to group information:

Navigation design can help users find their way and understand what the site is about.

Good navigation design principles:

SUMMARY

The following list of items are quoted directly from [Duckett, pg.475]

From the Duckett JS book

JS Book Introduction

Goals of this book [Duckett, pg.2]:

  1. Understanding some basic programming concepts and terms...
  2. Learning the language itself ... vocabulary and how to structure your sentances.
  3. Becoming familiar with how it is applied ... today.

JavaScript enables interactivity on a website. JS Can:

  1. Select text or elements, or find data input into a form.
  2. Modify items including text and attributes, and change proparties of items like images.
  3. Create rules for browser to follow, like: collect info, calculate a result, and then change webpage content.
  4. React, by taking action when something happens like a button click, textbox input change, page finishes loading, etc.

The book will also address work-around for compatibility with older browsers and introduce JQuery.

JS Chapter 1: “The ABC of Programming” (pp.11-52)

WHAT IS A SCRIPT AND HOW DO I CREATE ONE?
Think of a script as a recipe or manual, that tells the computer what to do.
When preparing to write a script, follow these steps: [Duckett, pgs.17]

Define the goal. What do you plan to achieve?
Design the script. Document smaller tasks and decision trees necessary to attain the stated goal.
Code each step. In this case, use JavaScript

Use flowcharts and lists to logically design the script:

Vocabulary: The keywords used in the script that a computer knows how to act upon.
Syntax: A kind of sentance structure of vocabulary the computer can execute.
Programmatic: Follow steps, one after another.

HOW DO COMPUTERS FIT IN WITH THE WORLD AROUND THEM?
Data Models: Represent what a thing is and what it can do.
Objects contain Properties, Events, and Methods.
Properties: Define what an object is, and contain data within the object like its color or state of being. Events: Represent actions such as flipping a light switch in a room.
Methods: Can take action on data, especially in response to events, such as a lamp illuminating when a light switch is flipped.

PROPERTIES, ATTRIBUTES, and EVENTS
An interesting note regarding properties and attributes [Duckett, pg.28]

The idea of name/value pairs is used in both HTML and CSS. In HTML an attribute is like a property:

In CSS you can:

Name-value pairs enable storing and acquiring property values. Example: A house can be painted a color. The property name could be 'paint' and the value could be 'yellow':
Object: House
Property name "color": value "yellow"

Consider Events to be the interaction between objects or things. Some examples of events that could be acted upon:

METHODS

A method defines what an object can do. It is a capability of a thing.
For example, when the user clicked the Submit button on the web page and that event was fired, the event can call a method that will show a popup message informing the user that the information was submitted successfully (or failed).

PROPERTIES, EVENTS, and METHODS

When developing scripts and web pages with JavaScript:

Back to the light switch example:

  1. The lightswitch object has a property ON that can be true or false.
  2. When the "flip switch" event occurs it will call a specific method to do some work.
  3. The called method changes the property from false to true, for example.

WEB BROWSERS ARE PROGRAMS BUILT USING OBJECTS

Primary objects are:

All major web browsers support a common set of objects:

Browsers perform these steps every time the URL is pointed to a valid document:

  1. Download the file containing all the code.
  2. Create models of the document, and the elements within it, and store it in memory.
  3. Launch a rendering engine to display the web page on the screen.

JavaScript is interpreted by a subsystem of the browser:

Key takeaway [Duckett, pg.43]

To make web pages interactive, you write code that uses the browser's model of the web page.

HOW JAVASCRIPT, HTML, AND CSS FIT TOGETHER

Keep code files separate as much as possible
This will make sure that partial page loads will still give the user some of the expected experience and information, rather than none.

CREATING BASIC JAVASCRIPT AND LINKING IT TO AN HTML PAGE

JavaScript is plaintext, so create a new file, name it with a .js extension and add JavaScript commands to it.
Create a simple web page and add the following element: <script src="file-name.js"></script>
When the browser reads this line it will stop to look for file-name.js in the current directory and try to execute it using the JavaScript interpreter before continuing on, rendering the next line of code.

Note: There is a very simple example of HTML + JavaScript usage, copied from Duckett, pgs.46-47, in the folder called chapter1_files here. Example webpage

HOW TO USE OBJECTS AND METHODS

document is an object that represents an entire page, as implemented in the web browser.
The 'document' model has several methods and properties, aka members.
The write() member is a method and accepts a string of text as the data parameters.