44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

Chapter 08: Adding Adding Interactivity Interactivity With With Behaviors Behaviors By Bill Bennett Associate Professor MSJC CIS MVC.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
NAMEd anchors Enabling users to jump to specific points within Web documents.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
JavaScript- Introduction. What it is and what it does? What it is? It is NOT Java It is NOT Server-side programming Users can see code It is a client-side.
Web Page Behavior IS 373—Web Standards Todd Will.
Computer Science 103 Chapter 4 Advanced JavaScript.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
NAMEd anchors Enabling users to jump to specific points within Web documents.
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.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
4.1 JavaScript Introduction
JS: DOM Form Form Object Form Object –The Form object represents an HTML form. –For each instance of a tag in an HTML document, a Form object is created.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
Introduction to JavaScript. JavaScript Facts A scripting language - not compiled but interpreted line by line at run-time. Platform independent. It is.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Event-driven Programming
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Introduction to JavaScript + More on Interactive Forms.
Internet Mark-up Languages CO32036 Part Lecture: Elementary JavaScript.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
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,
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
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.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
JavaScript - A Web Script Language Fred Durao
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
1 JavaScript
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Introduction to JavaScript CS101 Introduction to Computing.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Chapter 14: Dynamic HTML: Event Model Presented by: Colbie Brown CS340 Java Web Development Dr. Gloria Carter Love.
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.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES.
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,
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
Javascript JavaScript is what is called a client-side scripting language:  a programming language that runs inside an Internet browser (a browser is also.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Understanding JavaScript and Coding Essentials Lesson 8.
JavaScript Event Handlers. Introduction An event handler executes a segment of a code based on certain events occurring within the application, such as.
Chapter 4 Java Script - Part1. 2 Outlines Introduction to Java Script Variables, Operators and Functions Conditional statements JavaScript Objects Forms.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Adding Interactivity Comp 140 Fall Web 2.0 Major change in internet usage –From mostly static pages Text Graphics Simple links –To new paradigm.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Third lecture Event 27/2/2016 JavaScript Tutorial.
Week 4: Introduction to Javascript
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
JavaScript Defined General Syntax Body vs. Head Variables Math & Logic
Web Design and Development
JavaScript and Ajax (JavaScript Events)
Web Programming and Design
Presentation transcript:

44238: Dynamic Web-site Development Client Side Programming Ian Perry Room:C48 Extension:7287

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 2 Web-based ‘Scripting’  There are a number of ways of making your Web-pages more dynamic: most of which require the embedding of extra ‘scripts’ (i.e. ‘simple’ program code) within an HTML document.  These ‘scripts’ may then be interpreted either: Server Side (i.e. by a Web Server) Client Side (i.e. by a Web Browser)

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 3 VBScript  VBScript can be used BOTH: Server Side will work with any Web Browser. the interpretation of the VBScript happens on the Web Server, and a standard HTML-page is delivered to the Client. Client Side only works with Internet Explorer. Web Browsers such as Netscape DO NOT know how to interpret VBScript.

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 4 Client Side Programming  We will, therefore, be using JavaScript for all of our Client Side Programming: as it is much more portable, i.e. will ‘work’ on more hardware/software platforms than VBScript.  A program, written in a relatively simple scripting language (e.g. JavaScript); is passed, embedded in a HTML file, from a Server to a Client machine. the script then executes, under the control of a Web Browser (e.g. Internet Explorer or Netscape) on that Client machine (hence Client Side).

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 5 JavaScript  JavaScript is usually written as a series ‘functions’.  These JavaScript ‘functions’: are usually located within the … element of a HTML document. and tend to be ‘called’ as a result of a particular ‘event’ occuring, e.g.: a button being pressed. a new item being selected from a list. etc.

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 6 A simple Web-based Form  This simple form has two buttons on it.  What we want to do is to respond to an ‘event’.  In this case, when the user selects the “Press Me!” button.  To do this, we must modify the HTML code for the “Press Me!” button, so that it ‘calls’ a JavaScript function, like this: <input type="button" value="Press Me!“ name="B1" onClick="check()" >  When the “Press Me!” button is selected, an onClick ‘event’ will occur, which ‘calls’ the check() ‘function’.

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 7 A simple JavaScript Function A simple JavaScript Function function check() { alert("Thank You!") }

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 8 The Web-based Form in action!

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 9 Events?  Lots of ‘events’ to choose from. Can trigger an ‘event’ using Images & Hyperlinks as well as Form elements (e.g. Buttons, Lists, etc).  E.g.: onClick clicking on something. onChange changing the value of Form element. onMouseOver moving your mouse over something. onMouseOut moving your mouse off something.

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 10 Responding to Events  onClick Can be used with: Images & Hyperlinks, as well as buttons.  onChange Can be used to: do away with the need for buttons.  onMouseOver & onMouseOut Can be used to: swap Images to produce simple animations. produce rollover Text effects

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 11 onChange – no need for buttons - 1

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 12 onChange – no need for buttons - 2 The Code behind the ‘nextpage’ Drop-Down Box: Select a Page One Two

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 13 onChange – no need for buttons - 3 The ‘navigate()’ JavaScript Function: function navigate(form) { var go = (form.nextpage.options[form.nextpage.selectedIndex].value); document.location.href=go; } See it in action!

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 14 onMouseOver & onMouseOut for Image & Text manipulation  Image Swap <img border="0" src="blue.jpg" onMouseOver="src='red.jpg'" onMouseOut="src='blue.jpg'">  Text Rollover <font face="Arial" color="#0000FF“ onMouseOver="color='#FF0000'" onMouseOut="color='#0000FF'">Button See them in action!

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 15 The JavaScript ‘if’ Statement - 1  JavaScript functions can be written so that they can ‘decide’ between varieties of actions: depending upon values contained within, or set by, other form elements.  Understanding how to use the JavaScript ‘if’ Statement: is the key to such programed decisions.

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 16 The JavaScript ‘if’ Statement - 2  A simple ‘if’ Statement: if (test) { Resulting action, if test is passed. }  A more complex ‘if’ Statement if (test) { Resulting action, if test is passed. } else { Resulting action, if test fails. }

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 17 The JavaScript ‘if’ Statement - 2  Checking for a specific value in a Form field: function check() { if(form1.valuetocheck.value=="Hello") { alert("Thank you for typing 'Hello'") } else { alert("You MUST type 'Hello'") } valuetocheck

Ian Perry 44238: Dynamic Web-site Development: Client Side Programming Slide 18 Next Week’s Workshop  The Client Side Programming Tasks in next week’s Workshop concentrate on the use of JavaScript with which to interact with the user. Task 1 - a simple Web-based Form that can interact with the user. Task 2 - a Web-based Form that checks the value entered in a specific field, and displays a different message dependent upon this value. Task 3 - a Web-based Form that might form the basis of a Password Entry System, by checking for the presence of specific pairs of values in several fields. Task 4 - a Web-based Form that checks for the presence of mandatory values in specific fields, before allowing the user to proceed to the next Web-page. Task 5 – explore Web-based resources about Client Side Programming.