1 Final Exam Review Web Programming with HTML and Java.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
The Web Warrior Guide to Web Design Technologies
Understand Web Page Development Software Development Fundamentals LESSON 4.1.
1 Chapter 12 Working With Access 2000 on the Internet.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: HTML and Client-side code.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 7 Event-Driven.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
COMP 519: Web Programming Autumn 2014 Event-driven programs and HTML form elements  event-driven programs  onload, onunload  HTML forms & attributes.
CSC4370/6370: Web Programming Event-driven programs and HTML form elements  event-driven programs  onload, onunload  HTML forms & attributes  button,
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Javascript and the Web Whys and Hows of Javascript.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Introduction to JavaScript Dr. John P. Abraham University of Texas – Pan American.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
1 SEN 910 CSS/HTML Programming Final Exam Review.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
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.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
JSP Java Server Pages Softsmith Infotech.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
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,
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.
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
Web Programming : Building Internet Applications Chris Bates CSE :
1 Week 1 l HTML l Applets Applets and HTML. 2 Overview l Applets: Java programs designed to run from a document on the Internet l HTML: Hypertext Markup.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
1 Website Development HTML Forms and JavaScript Event-driven programs and HTML form elements  event-driven programs  ONLOAD, ONUNLOAD  HTML forms &
Client side scripting - javascript Pertemuan 4 Matakuliah: Web Programming Tahun: 2009.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
LOGO Introduction to Client-Side Scripting and JavaScript CHAPTER 9 Eastern Mediterranean University School of Computing and Technology Department of Information.
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(6) JavaScript:Introduction to Scripting.
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Introduction to JavaScript CS101 Introduction to Computing.
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.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Client-Side programming with JavaScript 2. Event-driven programs and HTML form elements event-driven programs  onload, onunload  HTML forms & attributes.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
1 CS 3520: Website Development Summer 2005 Course goals:  understand the technology and protocols underlying the World Wide Web  become familiar with.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
CSC 551: Web Programming Fall 2001 HTML forms & JavaScript events  HTML forms & attributes  button, text box, text area  selection list, radio button,
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
SEN 910 CSS/HTML Programming HTML Forms and JavaScript Event-driven programs and HTML form elements  event-driven programs  ONLOAD, ONUNLOAD  HTML forms.
1 CSC 551: Web Programming Spring 2004 Event-driven programs and HTML form elements  event-driven programs  ONLOAD, ONUNLOAD  HTML forms & attributes.
Introduction to HTML Simple facts yet crucial to beginning of study in fundamentals of web page design!
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Learning Aim C.  In this section we will look at how text, tables, forms and frames can be used in web pages.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
CSC 121 Computers and Scientific Thinking Fall Event-Driven Programming.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
Bayu Priyambadha, S.Kom.  HyperText Markup Language (HTML) is the language for specifying the static content of Web pages (based on SGML, the Standard.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
WWW and HTTP King Fahd University of Petroleum & Minerals
Website Development Course goals:
Chapter 27 WWW and HTTP.
Teaching slides Chapter 6.
Chapter 7 Event-Driven Pages
JavaScript is a scripting language designed for Web pages by Netscape.
Web Programming : Building Internet Applications Chris Bates CSE :
Presentation transcript:

1 Final Exam Review Web Programming with HTML and Java

2 Topics Covered Basic Web Development Concepts HTML JavaScript

3 Web  Internet Internet: a physical network connecting millions of computers using the same protocols for sharing/transmitting information (TCP/IP)  in reality, the Internet is a network of smaller networks World Wide Web: a collection of interlinked multimedia documents that are stored on the Internet and accessed using a common protocol (HTTP) e.g., , telnet, ftp, usenet, Instant Messenger, Napster, … Key distinction: Internet is hardware; Web is software Many other Internet-based applications exist

4 Static vs. dynamic pages most Web pages are static  contents (text/links/images) are the same each time it is accessed e.g., online documents, most homepages HyperText Markup Language (HTML) is used to specify text/image format as the Web moves towards online services and e-commerce, Web pages must also provide dynamic content  pages must be fluid, changeable (e.g., rotating banners)  must be able to react to the user's actions, request and process info, tailor services e.g., amazon.com, this course is about applying your programming skills to the development of dynamic Web pages and applications

5 Client-side programming JavaScript  a scripting language for Web pages, developed by Netscape in 1995  uses a C++/Java-like syntax, so familiar to programmers, but simpler  good for adding dynamic features to Web page, controlling forms and GUI Java applets  can define small, special-purpose programs in Java called applets  provides full expressive power of Java (but more overhead)  good for more complex tasks or data heavy tasks, such as graphics can download program with Web page, execute on client machine  simple, generic, but insecure

6 Server-side programming CGI programming  programs can be written to conform to the Common Gateway Interface  when a Web page submits, data from the page is sent as input to the CGI program  CGI program executes on server, sends its results back to browser as a Web page  good if computation is large/complex or requires access to private data Active Server Pages, Java Servlets, PHP, Server Side Includes  vendor-specific alternatives to CGI  provide many of the same capabilities but using HTML-like tags can store and execute program on Web server, link from Web page  more complex, requires server privileges, but secure

7 Hypertext Transfer Protocol (HTTP)  manages the hypertext links that are used to navigate the Web  ensures that Web browsers correctly process and display the various types of information contained in Web pages (text, graphics, audio, and so on) Uniform Resource Locators

8 The protocol portion of a URL is followed by a colon, two forward slashes, and a host A host refers to a computer system that is being accessed by a remote computer The host portion of a URL is usually www for “World Wide Web” Uniform Resource Locators

9 HTML Basics

10 Hypertext & HTML HyperText Markup Language (HTML) is the language for specifying the static content of Web pages  hypertext refers to the fact that Web pages are more than just text can contain multimedia, provide links for jumping within & without  markup refers to the fact that it works by augmenting text with special symbols (tags) that identify structure and content type

11 Web development tools many high-level tools exist for creating Web pages e.g., Microsoft FrontPage, Netscape Composer, Adobe PageMill, Macromedia DreamWeaver, HotDog, … also, many applications have "save to HTML" options (e.g., Word) for most users who want to develop basic, static Web pages, these are fine assembly language vs. high-level language analogy  may want low-level control  may care about size/readability of pages  may want to "steal" page components and integrate into existing pages  may want dynamic features such as scripts or applets so, why are we learning low-level HTML using a basic text editor?

12 Tags vs. elements HTML specifies a set of tags that identify structure and content type  tags are enclosed in specifies an image  most tags come in pairs, marking a beginning and ending and enclose the title of a page an HTML element is an object enclosed by a pair of tags My Home Page is a TITLE element This text appears bold. is a BOLD element Part of this text is bold. is a PARAGRAPH element that contains a BOLD element HTML document is a collection of elements (text/media with context)

13 Structural elements an HTML document has two main structural elements  HEAD contains setup information for the browser & the Web page e.g., the title for the browser window, style definitions, JavaScript code, …  BODY contains the actual content to be displayed in the Web page Title for Page Text that appears in the page HTML documents begin and end with and tags Comments appear between HEAD section enclosed between and BODY section enclosed between and

14 Text layout the BODY can contain multiple lines of text  text layout and spacing is pretty much ignored by the browser  every sequence of whitespace is interpreted as a single space  browser automatically wraps the text to fit the window size  can layout text in an HTML document for readability, will not affect how it is viewed Title for Page This is a whole lot of text that goes on and on and on and on.

15 Overriding default layouts for the most part, layout of the text must be left to the browser WHY? can override some text layout  can cause a line break using the tag (no closing tag)  can specify a new paragraph (starts on a new line, preceded by a blank line) using …  can force a space character using the symbol for a non- breaking space: Title for Page This is a paragraph of text made up of two lines. This is another paragraph with a GAP between some of the words. This paragraph is indented on the first line but not on subsequent lines.

16 The concept of a Cascading Style Sheets™ (CSS)

HTML Forms and JavaScript Event-driven programs and HTML form elements  event-driven programs  ONLOAD, ONUNLOAD  HTML forms & attributes  button, text box, text area  selection list, radio button, check box, password, hidden, …  JavaScript form events  properties: name, type, value, …  methods: blur(), focus(), click(), …  event handlers: onBlur(), onFocus(), onChange(), onClick(), …  advanced features & techniques  windows & frames, timeouts, cookies

18 Event-driven programs in C++, programs are serially executed  start with main function, execute sequentially from first statement  may loop or skip sections of code, but the program proceeds step-by- step the programmer specifies the sequence in which execution occurs (with some variability due to input values) there is a beginning and an end to program execution computation within a Web page is rarely serial instead, the page reacts to events such as mouse clicks, buttons, …  much of JavaScript's utility is in specifying actions that are to occur in the page as a result of some event the programmer may have little or no control over when code will (if ever) be executed, e.g., code that reacts to a button click there is no set sequence, the page waits for events and reacts

19 OnLoad & OnUnload the simplest events are when the page is loaded or unloaded  the ONLOAD attribute of the BODY tag specifies JavaScript code that is automatically executed when the page is loaded  the ONUNLOAD attribute similarly specifies JavaScript code that is automatically executed when the browser leaves the page Hello/Goodbye page function Hello() { globalName=prompt("Welcome to my page. " + "What is your name?",""); } function Goodbye() { alert("So long, " + globalName + " come back real soon."); } Whatever text appears in the page. view page in browser

20 HTML forms most event-handling in JavaScript is associated with form elements an HTML form is a collection of elements for handling input, output, and events in a page … form elements include: for input: button, selection list, radio button, check box, password, … for input/output: text box, text area, … we will revisit forms when we consider CGI programming  a form groups together elements, whose contents are submitted as one

21 Button element Fun with Buttons <input type="button" value="Click Me" onClick="alert('Thanks, I needed that.');" /> the simplest form element is a button  analogous to a real-world button, can click to trigger events attributes include: VALUE : specifies label that appears on the button ONCLICK : specifies code to be executed when clicked

22 Buttons & JavaScript Fun with Buttons <script type="text/javascript" src=" <input type="button" value="Click for Lucky Number" onClick="num = RandomInt(1, 100); alert('The lucky number for the day is ' + num);" /> view page in browser the ONCLICK event-handler can specify any JavaScript code  can be a sequence of statements inside quotes, can call functions, …

23 Buttons & functions Fun with Buttons function Greeting() // Results: displays a time-sensitive greeting { var now = new Date(); if (now.getHours() < 12) { alert("Good morning"); } else if (now.getHours() < 18) { alert("Good afternoon"); } else { alert("Good evening"); } <input type="button" value="Click for Greeting" onClick="Greeting();" /> for complex tasks, should define function(s) and have the ONCLICK event trigger a function call

24 Text areas a TEXT box is limited to one line of input/output a TEXTAREA is similar to a text box in functionality, but can specify any number of rows and columns Initial Text  Note: unlike a text box, a TEXTAREA has closing tag initial contents of the TEXTAREA appear between the tags  WRAP="virtual" specifies that text in the box will wrap lines as needed  as with a text box, no HTML formatting of TEXTAREA contents

25 JavaScript & frames Table of Squares alternatives for program output: 1.alert box : good for small messages 2.separate window : good for longer text, outside of page 3.text box / text area : integrated into page, but awkward & no formatting 4.frames : can easily write lots of output, integrated & fully formattable src="about:blank" loads a blank page into the frame (ready to be written to)

JavaScript client-side programming with JavaScript

27 JavaScript is not Java JavaScript is a very simple scripting language. Syntax is similar to a subset of Java. Interpreted language. Uses objects, but doesn't really support the creation of new object types

28 Client-side programming recall: HTML is good for developing static pages  can specify text/image layout, presentation, links, …  Web page looks the same each time it is accessed  in order to develop interactive/reactive pages, must integrate programming client-side programming  programs are written in a separate programming language e.g., JavaScript, JScript, VBScript  programs are embedded in the HTML of a Web page, with tags to identify the program component e.g., …  the browser executes the program as it loads the page, integrating the dynamic output of the program with the static content of HTML

29 Scripts vs. programs a scripting language is a simple, interpreted programming language  scripts are embedded as plain text, interpreted by application  simpler execution model: don't need compiler or development environment  saves bandwidth: source code is downloaded, not compiled executable  platform-independence: code interpreted by any script-enabled browser  but: slower than compiled code, not as powerful/full-featured

30 Common scripting tasks adding dynamic features to Web pages  validation of form data  image rollovers  time-sensitive or random page elements defining programs with Web interfaces  utilize buttons, text boxes, clickable images, prompts, frames limitations of client-side scripting  since script code is embedded in the page, viewable to the world  for security reasons, scripts are limited in what they can do e.g., can't access the client's hard drive  since designed to run on any machine platform, scripts do not contain platform specific commands  script languages are not full-featured e.g., JavaScript objects are crude, not good for large project development

31 JavaScript JavaScript code can be embedded in a Web page using SCRIPT tags  the output of JavaScript code is displayed as if directly entered in HTML JavaScript Page // silly code to demonstrate output document.write("Hello world!"); document.write(" How are " + " you ? "); Here is some static text as well. document.write displays text in page text to be displayed can include HTML tags the tags are interpreted by the browser when the text is displayed as in C++/Java, statements end with ; JavaScript comments similar to C++/Java // starts a single line comment /*…*/ enclose multi-line comments

32 Final questions to ponder… What technologies are available for the internet? Why would you want to use a scripting languages? What the difference between client side and server side applications? How can HTML be used with other languages? What are the basic parts of an HTML, and JavaScript document? How would you use these technologies to accomplish a task or provide a solution to a problem?

33 20 Questions Short answer questions Some minimal programming will be required Good Luck!