6 items | 2 visits
Notes from "Dive into HTML5" online text of book.
Updated on May 27, 11
Created on May 27, 11
Category: Computers & Internet
URL:
<canvas>
element has no content and no border of its own.<canvas>
element on the same page. Each canvas will show up in the DOM, and each canvas maintains its own state. If you give each canvas an id
attribute, you can access them just like any other element.
That leaves us with this root element:
<html lang="en">
<meta>
tag if present.
There are four basic techniques for detecting whether a browser supports a particular feature. From simplest to most complex:
Check if a certain property exists on a global object (such as window
or navigator
).
Example: testing for geolocation support
Create an element, then check if a certain property exists on that element.
Example: testing for canvas support
Create an element, check if a certain method exists on that element, then call the method and check the value it returns.
Create an element, set a property to a certain value, then check if the property has retained its value.
Content-Type
header under certain circumstances. (This is called “content sniffing.”)
<video>
tag; there is also a corresponding DOM API for video objects in the DOM.
6 items | 2 visits
Notes from "Dive into HTML5" online text of book.
Updated on May 27, 11
Created on May 27, 11
Category: Computers & Internet
URL: