Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A. Javascript is a high-level language that is interpreted ... C. Special Requirements for JavaScript: • Javascript instructions are case sensitive. Most of.
Typology: Study notes
1 / 4
(^) Javascript is a high-level language that is
(^) interpreted
( compiler vs interpreter
). Javascript and HTML are
two
different
computer
languages.
Javascript
is
more powerful webpages.embedded in HTML file. Together they can create
programmingMicrosystems (who developed Java), as a simple web^ Developed by Netscape, who worked jointly with Sun
language
in
The (^) language
is
supported
by most
browsers
(Netscape,
in 1991.)(HTML was developed at CERN for creating WWW
(^) Special Requirements for JavaScript
them are in lower case.Javascript instructions are case sensitive. Most of
interpreter will not recognize them.All instructions must be spelled correctly or the
and not run together.Parts of a instruction need to be separated by space
The correct punctuation must be used.
(^) Important Features of the Language
JavaScript allows for
(^) dynamic
(^) content while HTML
can only create
(^) static
(^) pages.
(interactive pages, event handling)^ Dynamic – webpage content changes overtime
(^) Static – the content of the page doesn’t change
machine, not remote server’s machine;Client-based: instructions are executed using user’s
server machine (security issue);Does not write files on either user's machine or the
Does not carry out graphics
components:Each instruction is made of one or more of theObject Oriented Programming Language
(^) object, method & property
object:
method:
property:
e.g.
document.bgColor = “red”;window.document.write(“Hello!”);
…
… (^) How to Add JavaScript into an HTML Program? …Javascript commands here
…
To insert it into HTML program, use
(^) window
(^) for the window object can be
tags. The output messages can be formatted using HTML document.write("This is just a statement"); assumed (ignored) – rewrite above as:
document.write("This is just a statement");
the background, useanother instruction. For example, to change the color of We can change the color of parts of the document using^ 2) document.bgColor document.bgColor = "red";
background color of the webpage).on its right (color “red”) to the element on its left (the ‘=’ is an assignment operator which assigns the value
There
(^) is an (^) alternative
(^) version
of (^) prompt()
(^) which
The returned to major.returned to major. If Cancel is clicked, a null value ismajor. When OK is clicked, the string in the text box isbe returned to major. The user can also type their own“CIS” already present. If the user clicks OK, “CIS” will Now, the user will see the text box with the string alert("Now I know your major is: " + major); var major = prompt("What is your major?", "CIS"); allows the programmer to give a default response: (^) + (^) operator connects pieces of messages together.