Docsity

Client-Side Scripting: From JavaScript Wars to DOM and Web 2.0, Slides of Fundamentals of E-Commerce

Partial preview of the text

Download Client-Side Scripting: From JavaScript Wars to DOM and Web 2.0 and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

CSCI 3110 Advanced Topics in Web Development

INTRODUCTION TO CLIENT-

SIDE WEB SCRIPTING

Client-Side Scripting

Script embedded in code delivered to browser. Browser executes. Docsity.com

Changing philosophy

Eye candy Google Maps Web 2. http://www.youtube.com/watch?v=bsNcjya56v8&feature=related

Key Client-Side Scripting Concepts

Script delivered to web browser as part of page source code. Browser runs the script. Interpreted language. Browser typically employs "___ script engine" to execute code and control content output and display. Browser variability (brand, version) can create challenges. Script source code is exposed to the user. Script runs in a "sandbox", restricting some functionality. User may disable script support. Docsity.com

Client-side scripting wars

JScript Microsoft's "clone" of JavaScript for Internet Explorer introduced in August 1996 in IE 3. Jscript Documentation:

Client-side scripting wars

ECMAScript Netscape submitted JavaScript to ECMA in November 1996 as suggested client-side web scripting standard. ECMA-262 adopted July 1997. JavaScript and JScript are both ECMAScript + minor unique enhancements to distinguish them. ECMAScript Documentation: http://www.ecmascript.org/docs.php IE's support for ECMAScript 5 version of Javascript. Docsity.com

End of the War (?)

Netscape was browser leader until ~1998. Internet Explorer—"free" (part of O/S). Netscape Navigator – free for non-commercial use. Legacy of Netscape lives on in Mozilla Firefox. JScript folded into .NET environment as JScript.NET although classic JScript still supported in browsers.

Contemporary JavaScript Components

JavaScript

Source: Zakas, N.C., Professional JavaScript for Web Developers. 2nd ed. 2009, Indianapolis, IN: Wiley Pub., p. 3 Docsity.com

Document Object Model (DOM)

DOM Level 1 debuted in 1998. W3C created standard in cooperation with Netscape and Microsoft. DOM Level 2 is the current standard, with DOM Level 3 in working draft (since early 2000s.) As long as we stick with DOM Level 2 code, we can be comfortable with the code working in any modern browser.

DOM

Many web designers criticize DOM… "The API of the browser, the Document Object Model (DOM) is quite awful, and JavaScript is unfairly blamed. The DOM would be painful to work with in any language. The DOM is poorly specified and inconsistently implemented… I think writing a Good Parts book about the DOM would be extremely challenging." Crockford, D., JavaScript: The Good Parts. 2008: O'Reilly, p. 3. Docsity.com

Simple DOM Example

**

Demo document

Hi there!

** html head title Demo document body p Hi there!

Browser Object Model (BOM)

Browser-specific scripting extensions for element access and manipulation. Not standardized. Examples of BOM functionality: Open, move, close, resize browser windows. Get information about the browser ('brand', version, etc.) Some areas of common overlap between browser platforms, but mostly divergent. Docsity.com