By Tharith Sriv. To write a web page you use: HHTML (HyperText Markup Language), AASP (Active Server Page), PPHP (HyperText Preprocessor), JJavaScript,

Slides:



Advertisements
Similar presentations
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Advertisements

WeB application development
Introduction to JavaScript Module 1 Client Side JS Programming M-GO Sponsored By
The Web Warrior Guide to Web Design Technologies
Languages for Dynamic Web Documents
Server-Side vs. Client-Side Scripting Languages
NAMEd anchors Enabling users to jump to specific points within Web documents.
Web Page Behavior IS 373—Web Standards Todd Will.
NAMEd anchors Enabling users to jump to specific points within Web documents.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
JavaScript Client Side scripting. Client-side Scripts Client-side scripts, which run on the user’s workstation can be used to: Validate user inputs entered.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Computer Concepts 2014 Chapter 7 The Web and .
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
Languages in WEB Presented by: Jenisha Kshatriya BCM SS09.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Chapter 19: Adding JavaScript
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Internet Mark-up Languages CO32036 Part Lecture: Elementary JavaScript.
DOM and JavaScript Aryo Pinandito.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
What is Java Script? An extension to HTML. An extension to HTML. Allows authors to incorporate some functionality in their web pages. (without using CGI.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Introduction to JavaScript Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan. 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
LOGO Introduction to Client-Side Scripting and JavaScript CHAPTER 9 Eastern Mediterranean University School of Computing and Technology Department of Information.
1 JavaScript
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
Event JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. When the page loads, that is.
1 Chapter 01: Introduction by Tharith Sriv. This course covers the following topics:  Hypertext Markup Language (HTML)  Cascading Style Sheets  JavaScript.
Dynamic Web Pages Jin Wu INF 385E Information Architecture School of Information 11/2/2006 Jin Wu INF 385E Information Architecture School of Information.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
WHAT IS SERVER SIDE SCRIPTING? Server-side scripting is a web server technology in which a user's request is verified by running a script directly on the.
COMP403 Web Design JAVA SCRİPTS Tolgay KARANFİLLER.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
COS 125 DAY 20. Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Pertemuan 5 IT133 Pengembangan Web JavaScript. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
JavaScript Events.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Beginning JavaScript 4 th Edition. Chapter 1 Introduction to JavaScript and the Web.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Introduction to Client-Side Scripting and JavaScript
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Web Development & Design Foundations with HTML5 7th Edition
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
JavaScript.
Introduction to JavaScript
CS105 Introduction to Computer Concepts
Web Design and Development
Tutorial 10: Programming with javascript
Web Programming– UFCFB Lecture 13
CS105 Introduction to Computer Concepts JavaScript
Presentation transcript:

By Tharith Sriv

To write a web page you use: HHTML (HyperText Markup Language), AASP (Active Server Page), PPHP (HyperText Preprocessor), JJavaScript, JJava, eetc.

JavaScript?  JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. What should I know before learning JavaScript?  Before you continue you should have a basic understanding of the following: HTML / XHTML

 JavaScript was designed to add interactivity to HTML pages  JavaScript is a scripting language  A scripting language is a lightweight programming language  JavaScript is usually embedded directly into HTML pages  JavaScript is an interpreted language (means that scripts execute without preliminary compilation)  Everyone can use JavaScript without purchasing a license

JavaScript? AA scripting language used for Web page design. EEnables you to enhance static web applications HHow? bby providing dynamic, personalized, and interactive content. FFirst appeared in 1995, its main purpose was to handle some of the input validation that had previously been left to server-side languages such as Perl.

 JavaScript is not the only scripting language; there are others such as VBScript and Perl.  So, why JavaScript?  Because of its widespread use and availability:  Many browsers support JavaScript.  VBScript is used for the same purposes as JavaScript. But, supported by very limited number of Web browsers (especially IE).

 The answer is NO!  Java and JavaScript are two completely different languages in both concept and design!  Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++.

 JavaScript gives HTML designers a programming tool - HTML authors are normally not programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages  JavaScript can put dynamic text into an HTML page - A JavaScript statement like this: document.write(" " + name + " ") can write a variable text into an HTML page

 JavaScript can react to events - A JavaScript can be set to execute when something happens, like when a page has finished loading or when a user clicks on an HTML element  JavaScript can read and write HTML elements - A JavaScript can read and change the content of an HTML element

 JavaScript can be used to validate data - A JavaScript can be used to validate form data before it is submitted to a server. This saves the server from extra processing  JavaScript can be used to detect the visitor's browser - A JavaScript can be used to detect the visitor's browser, and - depending on the browser - load another page specifically designed for that browser  JavaScript can be used to create cookies - A JavaScript can be used to store and retrieve information on the visitor's computer

 A simple text editor.  Notepad is possible.  EditPlus is recommended. How?  EditPlus is an advanced text editor  You can also use another Advanced Text Editor, those providing line numbering, search and replace tools, and so on.  For example, Adobe Dreamweaver, …

 With scripts in previous slide, Mozilla Firefox displays the following:

 Not all old Web browsers support JavaScript.  However, most of new Web browsers can support it.  Here are Versions of JavaScript which are supported by different Web browsers.

 In order to run client-side JavaScript, you must embed the code in the HTML document.  There are several different ways to embed JavaScript scripts in HTML: a. As statements and functions using the tag b. As event handlers using HTML tag attributes c. As short statements resembling URLs

The Tag Internal Scripts The tag is used to enclose JavaScript code in HTML documents. Here is the general syntax: [JavaScript statements...]

 The tag acts like all other HTML tags.  Notice that it must be followed by its closing counterpart,.  Every statement you put between the two tags is interpreted as JavaScript code.

1. In the same file as HTML. 2. Use an external js-file.  A way to do this is to write JavaScript codes and save it as a js-file (for example, myscript.js).  In your HTML file at where you want to write your JavaScript codes, just put something like: [additional javascript statements]

Remember, JavaScript can be placed only in  … tags of HTML file  Or in …  It works automatically when you write your JavaScript in …  JavaScript statements which are written in … start working when you start calling it by event handler.

 Try out! How?  In your js-file, write the script below using Notepad and save your file as abc1.js:

 In your HTML file, write:

 This is equivalent to:

 Previous slide result in what’s shown next slide:

 When you click OK you see:

 You can place JavaScript right into event handlers.  Event handlers are HTML tag attributes that refer to a specific action which takes place in reference to that form element.  Those include: onClick, onDblClick, onMouseDown, onMouseUp, onMouseOver, onMouseMove, onMouseOut, onKeyPress, onKeyDown, and onKeyUp

 Type the followings, then save it as test.html.

 NetScape Navigator displays what’s in previous slide as:

 JavaScript is a language  JavaScript is not Java  You use it to write a Web page.  You can put it in:  … or … of an HTML file.  short statements resembling URLs  You can use a separate js-file and include it in your HTML file.