HTML and CSS Reference

In-Depth Information

Later in the code,
geoWatchID
can be passed as an argument to
clearWatch()

to stop the position from updating:

clearWatch(geoWatchID);

SVG and MathML

SVG and MathML have two totally different purposes, but they have one thing in com-

mon: they are both XML-based languages that can be embedded in HTML5. Scalable

Vector Graphics (SVG) is for describing vector shapes, while Mathematical Markup

Language (MathML) is for describing mathematical notation.

SVG is one half, along with
canvas
, of the Web's standard imaging options. While

canvas
deals well with bitmaps, SVG deals well with vector shapes. It also has built-

in animation capabilities, which would need to be built from scratch in
canvas
.

The syntax of both is beyond what can be covered here, but being XML-based, they

both look very much like HTML, except with a different set of elements. For example,

the following code shows an HTML page that includes both MathML and SVG to de-

scribe and diagram the trigonometric functions shown in
Chapter 7
.

<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8" />

<title>SVG and MathML Demo</title>

</head>

<body>

<h1>SVG and MathML embedded in an

HTML5 page</h1>

<p>

<math>

<mi>x</mi>

<mo>=</mo>

<mrow>

<msub-

><mi>x</mi><mn>1</mn></msub>

<mo>+</mo>

<mi>cos</mi>

<m-

fenced><mi>θ</mi></mfenced>

Search WWH ::

Custom Search