Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
The Web Warrior Guide to Web Design Technologies
JavaScript 101 Lesson 01: Writing Your First JavaScript.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Tutorial 10 Programming with JavaScript
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Introduction to scripting
PHP: Introduction By Trevor Adams.
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
Forms and Java script. Forms The graphical user interface -textbox, radio, button, textarea, checkbox… The processing script –CGI scripts, Perl script,
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JSP Java Server Pages Softsmith Infotech.
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.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
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.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
1 JavaScript in Context. Server-Side Programming.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
JavaScript Syntax, how to use it in a HTML document
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Introduction to JavaScript CS101 Introduction to Computing.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
1 JavaScript in Context. Server-Side Programming.
Javascript JavaScript is what is called a client-side scripting language:  a programming language that runs inside an Internet browser (a browser is also.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Javascript Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
Module 1 Introduction to JavaScript
Tutorial 10 Programming with JavaScript
JavaScript is a programming language designed for Web pages.
JavaScript.
JavaScript an introduction.
WEB PROGRAMMING JavaScript.
Tutorial 10 Programming with JavaScript
JavaScript CS 4640 Programming Languages for Web Applications
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
An Introduction to JavaScript
Introduction to Programming and JavaScript
JavaScript: Introduction to Scripting
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

Overview of Form and Javascript fundamentals

Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2. The name describes the link to another web page 3. This is the address of a resource on the Internet 4. tag is used to create this 5. The basic structure of an HTML document includes this 6. tag is used to create this 7. computer that manages and shares web based applications accessible anytime from any computer connected to the Internet a. Anchorb. Tag c. URLd. Unorder list e. Order listf. Web server g. Web browser

Creating a form

Please share any suggestions or comments with us: Comments?

Creating a form The field with the NAME attribute equal to comments had a VALUE equal to Comments? This is my comments The field with the NAME attribute equal to submit had a VALUE equal to Order Bed

Creating an form Please share any suggestions or comments with us: Comments?

Creating GUI component Textbox: Radio button King Queen

Creating GUI component Creating checkboxes Foodboard Drawers

Creating GUI component Creating selection box:

Creating GUI component Component_1 Component_2 Component_3 ……

Adding hidden field to a form Why do we need hidden fields? –To keep the status of the program –To transfer data between different forms

Practice 1.Open Textpad and cut & paste this code HTML form /title> And save it as form.html

Practice 2. Insert HTML and Java script code to : - set up a simple form, as shown below.

Javascript fundamentals Client side programming / scripting language Originally named LiveScript Javascript is NOT: –Java (it is objected-based instead of object oriented, javascript is interpreted instead of compiled) –HTML –Java applets

Javascript is Used at client-side (Used when offloading work from the server to the client) NOT a Server Side language such as Java Server Pages JSP Java Servlets

JavaScript JavaScript can be edited in text editors like other languages JavaScript can be immediately tested by loading into a WEB browser such as Netscape or Internet Explorer Syntax mistakes are not found until the page is loaded Differences in browser JavaScript interpreters can cause incompatibility problems

What Javascript is Used for Dynamic table Example: le/index.html le/index.html EC Applications Example: Decision maker helperDecision maker helper

What Javascript is Used for Development of GUI Example: simple calculatorsimple calculator more colorful calculator Client-side content filters Example: Content-filtering

Where to put JavaScript ? Internally: Embedded inside HTML head tags, body tag: document.writeln(“ Hello World ”); Externally: save in a separate file and link by src= in the script tag.

Lab 2 Question: From your observation, please describe the difference between step 2 and 3 in the lab

Elements of JavaScript Uses variables Uses looping constructs –For loops –While loops Uses Functions –Pre defined –User defined Uses well defined Document Object Model (DOM) Uses Event Handling to trigger code

Summary Benefits of JavaScript –Basic level of programmability for all client-side processing –Validation of data entered into a WEB based form –Dynamic HTML –Used in conjunction with Java Server Pages to manipulate database information –Reduction of client to server communications Each HTTP request/response protocol generates for network operations

Summary (continued) Disadvantages –Writing data back to the server directly –Java applets that execute method calls on remote server objects. JavaScript cannot do this process directly. –Poor security model Any user can access your JavaScript code via the View Source menu item Even external libraries are not very secure –Creating specialized programming architecture, such as a component model

Fundamentals of Javascript (continue) Question: Please describe one advantage (that you really like) and one disadvantage of Javascript (that concerns you the most) of Javascript?

Location of Javascript code Scripts can be located in the section of the HTML document Scripts can also be located in the section of the HTML document The scripts which might be called by later code should be located in the section so they will be available to run

Important points All statement lines should be delimited with a semi-colon Most statements exist on separate lines by normal conventions but can be combined Even though a line of code may run without a semi-colon, some browser interpreters may not execute the code properly

Comments Comments are a useful way of documenting your code –//single line comment –/*multiple lines of comments can be created with the pairs “/*” and “*/” */

Variables A variable is a data item whose value can change var myAge = 51; var firstTime = true; Types supported: –Numeric –String –Boolean –Null –Undefined

Using Variables and Data Types JavaScript does not use strict data type as many other languages As values are assigned to the variables they fall into one of several category types –Data Types TableData Types Table Variables can be evaluated using different operators

Declaring a Variable Syntax: var ; Or var = ;

Variable name Variable Names (also referred to as Identifiers) must begin with a letter or an underscore and cannot be a reserved word. Variables are case sensitive and may not contain a space. Example: Part_no ???? Part.no ????

Declaring a Variable Variables can be assigned literal data, operations on variables, and logical expressions –var myScore = 100; –var newScore = myScore + yourScore; –var highScore = (myScore > yourScore); Declaring a variable without giving it a value will cause an “undefined” value to be assigned –var partNumber –partNumber would have a value of “undefined” Variables cannot be named using reserved words –Reserved Words TableReserved Words Table