1 / 13

Introduction to JavaScript

Introduction to JavaScript. CINS/WEBT 143 Jim Doran. Understanding Client/Server Architecture. Web built on a two-tier client/server system Requests and responses through which a Web browser and Web server communicate happen with HTTP. Web Standards. Behavior. JavaScript.

ghita
Download Presentation

Introduction to JavaScript

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to JavaScript CINS/WEBT 143 Jim Doran

  2. Understanding Client/Server Architecture Web built on a two-tier client/server system • Requests and responses through which a Web browser and Web server communicate happen with HTTP

  3. Web Standards Behavior

  4. JavaScript JavaScript is an implementation of the ECMAScript language standard and is typically used to enable programmatic access to computational objects within a host environment.

  5. JavaScript • JavaScript (brief) history • Developed by Brendan Eich as Mocha • First introduced in Navigator (LiveScript) • Navigator 2.0: name changed to JavaScript 1.0 • Microsoft released Internet Explorer 4.0 version of JavaScript (Jscript) • ECMAScript • International, standardized version of JavaScript • Most recent version: edition 3

  6. JavaScript and Client-Side Scripting • When HTML was first developed, Web pages were static • Static Web pages cannot change after the browser renders them • HTML and XHTML could only be used to produce static documents • JavaScript • Client-side scripting language that allows Web page authors to develop interactive Web pages and sites

  7. JavaScript Advantages • Adds dynamic behavior to Web pages • Used to “remember” state • Access to browser information, form elements, images • Can be used to amend browser shortcomings Disadvantages • No mechanism for creating a network connection or accessing a database • Cannot be used outside the Web browser (sort of) • Same domain policy (for now)

  8. Client-side Scripting • Executes in the browser on the user’s computer after the page elements are downloaded • Reduces processing load on the Web server, taking advantage of the client machine • Speeds up user experience

  9. Server-side Scripting • Executes on the Web server before the page is presented to the visitor • Can handle file manipulation, document creation and modification • Database connectivity • More secure, more powerful (heavy lifting) • PHP, ASP, ColdFusion, Java, CGI, etc.

  10. Server-side Scripting

  11. Server-side Scripting

  12. JavaScript <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The Hello World Page</title> <script type="text/javascript"> alert("Hello, World!"); </script> </head> <body> </body> </html>

  13. JavaScript • JavaScript is case sensitive • Avoid putting code in the <body></body> if possible (separation of content, formatting and behavior) • Use JavaScript to progressively enhance your documents (lots on this later) • Let’s take a look…

More Related