Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

JavaScript Fundamentals: An Overview, Lecture notes of Web Programming and Technologies

Web lab manual with theory notes

Typology: Lecture notes

2018/2019

Uploaded on 10/27/2019

kruti-kriti
kruti-kriti 🇮🇳

2 documents

1 / 67

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Overview of JavaScript
Originally developed by Netscape
Joint Development with Sun Microsystems in 1995
Standard 262 (ECMA-262) of the European Computer Manufacturers Association
ECMA-262 edition 3 is the current standard
Edition 4 is under development
Supported by Netscape, Mozilla, Internet Explorer
Differences
JavaScript has a different object model from Java
JavaScript is not strongly typed
Java 1.6 has support for scripting
http://java.sun.com/javase/6/docs/technotes/guides/scripting/index.html
Mozilla Rhino is an implementation of JavaScript in Java
http://www.mozilla.org/rhino/
Origins
Java and JavaScript
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43

Partial preview of the text

Download JavaScript Fundamentals: An Overview and more Lecture notes Web Programming and Technologies in PDF only on Docsity!

Overview of JavaScript

➢ Originally developed by Netscape ➢ Joint Development with Sun Microsystems in 1995 ➢ Standard 262 (ECMA-262) of the European Computer Manufacturers Association ➢ ECMA- 262 edition 3 is the current standard

  • Edition 4 is under development ➢ Supported by Netscape, Mozilla, Internet Explorer ➢Differences JavaScript has a different object model from Java JavaScript is not strongly typed ➢Java 1.6 has support for scripting http://java.sun.com/javase/6/docs/technotes/guides/scripting/index.html ➢Mozilla Rhino is an implementation of JavaScript in Java http://www.mozilla.org/rhino/ Origins Java and JavaScript

JavaScript Components

➢ Core

The heart of the language

➢ Client-side

Library of objects supporting browser control and user interaction

➢ Server-side

Library of objects that support use in web servers

➢ Text focuses on Client-side

XHTML/JavaScript Documents ➢ When JavaScript is embedded in an XHTML document , the browser interpret ‘s it with Java Interpretor to run or execute.Two locations for JavaScript server different purposes

  • JavaScript in the head element will react to user input and be called from other locations
  • JavaScript in the body element will be executed once as the page is loaded ➢ Various strategies must be used to ‘protect’ the JavaScript from the browser
  • For example, comparisons present a problem since < and > are used to mark tags in XHTML
  • JavaScript code can be enclosed in XHTML comments
  • JavaScript code can be enclosed in a CDATA section

JavaScript in XHTML: CDATA ➢ The block is intended to hold data that should not be interpreted as XHTML ➢ Using this should allow any data (including special symbols and -- ) to be included in the script ➢ This, however does not work, at least in Firefox: **__** ➢ The problem seems to be that the CDATA tag causes an internal JavaScript error **JavaScript in XHTML** ➢ This does work in Firefox **__** ➢ The comment symbols do **not bother the XML parser** (only /* and */ are ‘visible’ to it) ➢ The comment symbols protect the CDATA markers from the JavaScript parser

Directly embedded < **_script type=“text/javascript”>

_** ➢ However, note that a-- will not be allowed here! ➢ **Indirect reference** **_