Classifications of Languages - Introduction to Java Script - Lecture Slides, Slides of Javascript programming

Here is my collection on JavaScript lectures. It includes tutorials as well as general concepts explanations. Particularly these slides contain: Classifications of Languages, Compiled Vs Interpreted, Object Oriented, Scripting, Web Scripting Languages, Object Oriented, Fundamental Concepts, Javascript Comments, Events and Functions

Typology: Slides

2013/2014

Uploaded on 01/29/2014

surii
surii 🇮🇳

3.5

(13)

121 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to JavaScript
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Classifications of Languages - Introduction to Java Script - Lecture Slides and more Slides Javascript programming in PDF only on Docsity!

Introduction to JavaScript

Classifications of Languages

  • High-Level vs Low Level
    • Remember that Information Technology is VERY layered
  • Compiled vs Interpreted
  • Structured vs Object Oriented
  • Scripting vs Programming

Web Scripting Languages

  • Combine PL tools to make easier to use
  • Fewer features
  • Less versatile
  • Can be client side or Server side
    • Server side –
      • Invoked from browser
      • Run on the server
    • Client side - JavaScript
      • Invoked and Run on the browser

JavaScript

  • Extends functionality of Web pages
  • Written in the HTML Document
  • Controls page elements
  • Reacts to user actions
  • Instructions - code downloaded as text
  • Platform independent
  • Object Oriented

Object Examples

Object Attribute Things it can do

Computer Brand name Model Name Processor Type Processor Speed Disk Drive

Boot up Run an application Perform math calculations Shut down

Disk Drive Brand name Model name Storage capacity Transfer rate Access time

Store information Retrieve information Delete information

JavaScript Object Example

Object Attribute Things it can do

document bgColor linkColor vlinkColor title

clear() close() writeln() write()

  • To Reference Properties and methods
    • document.title
    • document.bgColor
    • document.writeln(My Heading)

JavaScript Variables

  • Variables: containers for data
    • All variables have
      • Name
      • Type – JavaScript is loosely typed
      • Value or “null”
      • To declare a variable
        • var variablename
      • Beware of reserved words (book page 558)

The Document Object Model

  • Internal road map of

objects on a web page

  • Hierarchical model of

web browser objects

  • Old DOMs for

Netscape, Microsoft

  • New browsers use the

standard DOM by W3C

A Word About Comments

  • JavaScript Comments
    • These comments must be within a script
    • // begins a single line comment
      • These can start anywhere on the line, but the remainder of the line becomes a comment
    • /* All of your comments here… */
      • Everything between the start and end comment markers are comments
      • Can be on a single line or span many…
  • HTML Comments

JavaScript in HTML, Template

** My page with javascript

the page requires a browser with javascript ...**

Events and Functions

  • Many event handlers are supported
    • onmouseover, onmouseout, onclick
    • …/swap image.html
  • Functions have Three parts
    • The function keyword
    • Parenthesized, comma-separated list of arguments
    • Statements enclosed in curly brackets
    • …/function ex.html

Attributes and Reusable code

  • You can pass attribute to a function
    • …///jsfunct.html
  • Use the src attribute of the