Download JavaScript

yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Abstraction (computer science) wikipedia , lookup

Programming language wikipedia , lookup

Smart Pascal wikipedia , lookup

Structured programming wikipedia , lookup

C Sharp syntax wikipedia , lookup

Object-oriented programming wikipedia , lookup

C++ wikipedia , lookup

Falcon (programming language) wikipedia , lookup

IBM TPNS wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

AppleScript wikipedia , lookup

Go (programming language) wikipedia , lookup

JavaScript wikipedia , lookup

Developer Essentials
How to Code
Language Constructs
The DOM concept- API, (use W3C model)
– properties
• Methods
• Events
• Applications;
– Rollovers
– Smart Forms
– Cookies
• A programming Language that adds
interactivity to Web Pages
– a scripting language
• A JS script is a program that is included in
an HTML page
• A JS script is interpreted by Web browsers
• Related Scripting Languages
– VbBasic, ActionScript:Flash, Adobe :JScript, Mac & .NET
• Used to be “Live Script”
– Plus more!
What can JavaScript do
• Create an active user interface
• Validate user input on Forms
• Create HTML pages on the fly
• Control Web Browsers
Can’t do
• Talk to databases
• Write to files
• Keep a counter or Track of State!
We use JavaScript for:
Tailoring the experience
– Different content based on criteria
• Extending the experience
– Dynamic pages
– User interface elements eg; pop-up menus
• Validating input
– Pre processing forms
JScript Language
• Characteristics
– where to place code
– statements
• Programming Concepts
– Sequence
– Selection
– Iteration
• Server side vs Client side
JS- Statements
Invoke Object Methods
Initialise or Define Variables
Manipulate Variables
Invoke a Function
Make Programming Decisions
JS- Statements cont.
• When the HTML Document Loads
• Immediately after the Doc Loads
• Respond to USER Action
– Event Handler
• When invoked by other Script Statements
JS- example
<title>My First JavaScript Script</title>
<style type=“text/css”>
.highlight {font-weight: bold}
<h1> Let the Scripting begin ......</h1>
<script type=“text/javascript” language=“javascript”>
<!-- hide script form old browsers
document.write(“This browser version” + navigator.appVersion);
document.write(“of <span class=‘highlight’>” + navigator.appName +
//end the script hiding -- >