What is syntax?
The structure of statements in a computer language.
Why is there a need to use JavaScript and CSS in the Web 2.0?
The Web 2.0’s content (constructed using HTML) has a style/layout (constructed using CSS) as well as a behaviour (controlled using JavaScript).
What does the basic structure of an HTML document include?
How do you include CSS (as a file) in an HTML document?
Included in the head using the following syntax:
< link rel=”stylesheet” type=”text/css” href=”theme.css” >
Note: “theme.css” refers to a hypothetical CSS file.
What kind of syntax could be included in a CSS file? (E.g. theme.css)
An example element could be:
h1 { color: green; } –> note the American spelling
How do you include JavaScript (as a file) in an HTML document?
Included in the body using the following syntax:
< script src=”my_script.js” > < / script >
How do you call a JavaScript function?
Identify the name of the function that was ‘called’/included in the HTML.
E.g. buttons can be specified in an HTML document using the following syntax:
< button type=”button” onclick=”myFunction()” >Date < / button >
In this case, you should state “myFunction();” in the JavaScript to call this function.
What kind of syntax is included in a JavaScript file? (E.g. my_script.js)
The file would include the following syntax:
function myFunction() {
document.getElementById("demo").innerHTML = Date();
}Note: getElementById(“demo”) would refer to an element in the HTML with Id “demo” so for example,
< p id=”demo” > < / p >
What are some useful things you can do with JavaScript?
JavaScript aids in giving the user more control over the browser. It allows the creation of:
What are some things that should be considered when implementing JavaScript into an HTML document?
Different browsers may produce different results:
What are variables?
What are some different types of variables?
What are some examples of pre-defined functions in JavaScript?
How is a function defined in JavaScript?
Give an example of a defined function in JavaScript.
var age=42;
function showAge() {
alert("You are" + age);
age= 65;
}What does a defined function essentially do?
Illustrates a set of commands to say how the function will operate when the function is called.
E.g. similar to the way a microwave’s function is defined in the specifications, it does not operate until the ‘start’ button is pushed so calling a function is the equivalent to pushing the ‘start’ button.
What are the fundamental characteristics of HTML?
What needs does XML aim to fulfil?
Needs are born of the desire to make markup language more compatible across different applications/services, concentrating on structured representation of knowledge, so to achieve this there is a need for:
What does the basic structure of an XML document include?
The building blocks of XML are referred to as elements. An element consists of:
Give an example of an XML element which highlights that structure is determined by administrator.
Structure invented for context of “furniture”:
< table >
< name >African Coffee Table< / name >
< width >80< / width >
< length >120< / length >
< / table >In this case, a table is characterised by name, width and length. However, it doesn’t tell use if a height field can be included to conform to a table.
To make clear the rules for a table to a machine, a definition of a table has to be provided. This can be achieved with a DTD (document type definition) or an XML Schema.
How is an attribute defined in XML syntax?
Values of attributes are assigned using an equal sign followed by value which must be in quotation marks (e.g. name=”Susie”)
What are the rules associated with nesting in XML syntax?
< root > < child name=”susie” > < subchild > ... < / subchild > < / child > < / root >
Elements must be nested properly.
What does it mean for an XML document to be well-formed and valid?